mirror of https://github.com/axmolengine/axmol.git
[js-tests] add Change skin tests
This commit is contained in:
parent
80a207ae43
commit
479676cbd8
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue