mirror of
https://github.com/photonstorm/phaser
synced 2025-02-16 14:08:28 +00:00
Fixed setSkin method and added other helper methods
This commit is contained in:
parent
00661c4d5d
commit
7b96356cfc
1 changed files with 74 additions and 1 deletions
|
@ -234,6 +234,37 @@ var SpineGameObject = new Class({
|
||||||
return output;
|
return output;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getSkinList: function ()
|
||||||
|
{
|
||||||
|
var output = [];
|
||||||
|
|
||||||
|
var skeletonData = this.skeletonData;
|
||||||
|
|
||||||
|
if (skeletonData)
|
||||||
|
{
|
||||||
|
for (var i = 0; i < skeletonData.skins.length; i++)
|
||||||
|
{
|
||||||
|
output.push(skeletonData.skins[i].name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return output;
|
||||||
|
},
|
||||||
|
|
||||||
|
getSlotList: function ()
|
||||||
|
{
|
||||||
|
var output = [];
|
||||||
|
|
||||||
|
var skeleton = this.skeleton;
|
||||||
|
|
||||||
|
for (var i = 0; i < skeleton.slots.length; i++)
|
||||||
|
{
|
||||||
|
output.push(skeleton.slots[i].data.name);
|
||||||
|
}
|
||||||
|
|
||||||
|
return output;
|
||||||
|
},
|
||||||
|
|
||||||
getAnimationList: function ()
|
getAnimationList: function ()
|
||||||
{
|
{
|
||||||
var output = [];
|
var output = [];
|
||||||
|
@ -299,7 +330,13 @@ var SpineGameObject = new Class({
|
||||||
|
|
||||||
setSkinByName: function (skinName)
|
setSkinByName: function (skinName)
|
||||||
{
|
{
|
||||||
this.skeleton.setSkinByName(skinName);
|
var skeleton = this.skeleton;
|
||||||
|
|
||||||
|
skeleton.setSkinByName(skinName);
|
||||||
|
|
||||||
|
skeleton.setSlotsToSetupPose();
|
||||||
|
|
||||||
|
this.state.apply(skeleton);
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
@ -324,6 +361,42 @@ var SpineGameObject = new Class({
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getAttachment: function (slotIndex, attachmentName)
|
||||||
|
{
|
||||||
|
return this.skeleton.getAttachment(slotIndex, attachmentName);
|
||||||
|
},
|
||||||
|
|
||||||
|
getAttachmentByName: function (slotName, attachmentName)
|
||||||
|
{
|
||||||
|
return this.skeleton.getAttachmentByName(slotName, attachmentName);
|
||||||
|
},
|
||||||
|
|
||||||
|
setAttachment: function (slotName, attachmentName)
|
||||||
|
{
|
||||||
|
return this.skeleton.setAttachment(slotName, attachmentName);
|
||||||
|
},
|
||||||
|
|
||||||
|
setToSetupPose: function ()
|
||||||
|
{
|
||||||
|
this.skeleton.setToSetupPose();
|
||||||
|
|
||||||
|
return this;
|
||||||
|
},
|
||||||
|
|
||||||
|
setSlotsToSetupPose: function ()
|
||||||
|
{
|
||||||
|
this.skeleton.setSlotsToSetupPose();
|
||||||
|
|
||||||
|
return this;
|
||||||
|
},
|
||||||
|
|
||||||
|
setBonesToSetupPose: function ()
|
||||||
|
{
|
||||||
|
this.skeleton.setBonesToSetupPose();
|
||||||
|
|
||||||
|
return this;
|
||||||
|
},
|
||||||
|
|
||||||
getRootBone: function ()
|
getRootBone: function ()
|
||||||
{
|
{
|
||||||
return this.skeleton.getRootBone();
|
return this.skeleton.getRootBone();
|
||||||
|
|
Loading…
Add table
Reference in a new issue