Sign in to follow this  
tinto22

Possible to attach another Spine sprite to a Spine sprite's slot/bone?

Recommended Posts

Hi,

I'm using Pixi, Spine and https://github.com/pixijs/pixi-spine. I've been reading through the code but can't see a way to attach a Spine sprite to another Spine sprite's bone/slot. Is this possible? I have been able to swap out an attachment for another Texture, but not another sprite.

The use case is that we'd like our player sprite (a Spine sprite) to be able to hold weapons which are another Spine sprite, where the weapon can be swapped in and out. This seems like it would be a fairly common use-case, so I feel like I'm just missing how to do it. If it's not possible, are there other ways people have done this in the past with Spine?

Thanks for any help anybody can offer.

Share this post


Link to post
Share on other sites

Spine instance as certain way to manage containers and sprites inside. Its described in https://github.com/pixijs/pixi-spine/blob/master/src/Spine.ts .

It is not obvious which things can be controlled by something else, what if spine runtime just deletes your sprite? That's why excurse in source code is needed anyway. Its good that you already read it.

Yes, There were cases like that, but people who used it did not report back and did not make PR to add it to examples: https://github.com/pixijs/pixi-spine/tree/master/examples

Basically, you need to take container with same number as slot id and put your sprite there. If you succeed, please report back :)

Welcome to the forums!

Edited by ivan.popelyshev

Share this post


Link to post
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.

Guest
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.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.