[js-tests] add Change skin tests

This commit is contained in:
VisualSj 2015-08-03 18:10:31 +08:00
parent 80a207ae43
commit 479676cbd8
1 changed files with 17 additions and 0 deletions

View File

@ -95,10 +95,27 @@ var runActionTimeLineTest;
callback: function(){
action.play("stand", true);
}
},{
title: "change skin",
callback: function(){
if (weapSkinToAdd.isVisible())
weaponHandeBone.displaySkin("3", true);
else
weaponHandeBone.displaySkin(weapSkinToAdd, true);
}
}
];
var weaponHandeBone = node.getBoneNode("Layer20");
var weapSkinToAdd = new cc.Sprite("ActionTimeline/testAnimationResource/girl_arms.png");
weapSkinToAdd.setName("Knife");
weapSkinToAdd.setPosition(cc.p(135, 23));
weapSkinToAdd.setScale(3.0);
weapSkinToAdd.setRotation(86);
weaponHandeBone.addSkin(weapSkinToAdd, false);
items.forEach(function(item, index){
var menuItem = new cc.MenuItemFont(item.title, item.callback, this);
menuItem.setPosition((index / 7 | 0) * 100, 120 - index % 7 * 30);