• Runtimes
  • (SFML) Attachments

Hi,

I'm creating the most awesome multiplayer online ninja game ever. Since Spine as a tool is almost as awesome as my game will be, I'm using it. 😉

I was wondering what is the best way to change e.g. eyes or weapon. I'm planning to add them from separate images. If I'm having like tens of different eye, hair, boot, weapon etc. alternatives I guess there's no point of using skins?

I couldn't find a clear example of using attachments (at least with sfml).

I'm having a single atlas and animation state for multiple ninjas. Is working with attachments still possible? Loading new atlas and animation state for each and every ninja is kinda heavy.

My code structure:

Atlas *ninjaAtlas = NULL;
SkeletonJson *ninjaSkeletonJSON = NULL;
SkeletonData *ninjaSkeletonData = NULL;
AnimationStateData *ninjaStateData = NULL;

class cNinja
{
Skeleton* skeleton;
SkeletonDrawable* drawable;
...
};

Thanks!

PS. And in case you wonder, yes, my code works perfectly at this point. 😉

PPS. And if here's someone who want's to combine teeworlds & naruto (and can draw or/and animate well), feel free to contact me.

Related Discussions
...
  • Modifié
4 jours plus tard

If you have many attachments you can create a skin at runtime and populate it as needed. The reason to do this would be to animate image changes for images that come from a skin. See the skin docs for why.
http://esotericsoftware.com/spine-using-runtimes/#skin

You can change attachments by using Skeleton setAttachment or Slot setAttachment.

You can (and probably should) create an AnimationState per ninja. You likely only need 1 SkeletonData and 1 AnimationStateData.