Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

Spine plugin - utility function to create character from multiple skins


PKrawczynski
 Share

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

@PKrawczynski

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']);
player.setSkin('mySkinName');

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!

panda2-plugin-spine-1_2_2.zip

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. 

results.zip

Link to comment
Share on other sites

2 minutes ago, enpu said:

@PKrawczynski

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

 Share

  • Recently Browsing   0 members

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