Jump to content

Spine plugin - utility function to create character from multiple skins


Recommended Posts

Hello, as We've discussed on twitter I'm posting request on forum :)


Phaser has a very neat utility method called "createCombinedSkin" which takes array of values where first value is string name that user can later call to display complex skin made of multiple skins and following values in array are names of skins themselves that will be used for that combined skin.

That way you can easily create customizable character made from multiple elements like ie. ["body_male_1","eyes_small","nose_huge","chest_armor_gold","leg_armor_plate_3","shoes_silver_17"]

Link to comment
Share on other sites


I have now added two new methods to Spine class, createSkin and setSkin.

You should be now able to create and use combined skins like this:

var player = new game.Spine('player.json');
player.createSkin('mySkinName', ['skin1', 'skin2', 'skin3']);

Here is attached new version of Spine plugin. Can you confirm that it works as it should before i update it to the website. Thanks!


Link to comment
Share on other sites

@enpu took quick look and I'm not sure if I made mistake or if it doesn't work yet.

I've attached modified example with "CombinedSkins" scene, and I've added art files as well plus json config. It displays naked body when first skin is "WhiteSkinTone" (and nothing else), however when I change first array element it display that element instead of body (so if I put "PirateCyberHat" it does display hat but it stops displaying body). Basically it disregards all other elements that are in array except first. 


Link to comment
Share on other sites

2 minutes ago, enpu said:


Thanks for all the info, there is definitely something wrong.

This doesn't seem to work with the Pixi Spine plugin either: https://github.com/pixijs/pixi-spine/issues/227

Could you give me a link to the Phaser Spine plugin source code, so i could take a look what's different there?

As far as I know (from @blackmoondev) it's this plugin https://github.com/orange-games/phaser-spine , I hope this helps :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...