spine icon indicating copy to clipboard operation
spine copied to clipboard

Issues with loading a different skin + Is there a workaround/better way?

Open bencresty opened this issue 3 years ago • 2 comments

Hi,

I am trying for a while now to switch skins, but I come across some issues in pixi-spine when different skins not share all the attachments.

I have two skins where skin A has all attachments in place, but skin B doesn't need some of these attachments. So I've tried two ways to achieve this, but both are working fine in Spine, but not in pixi-spine's runtime;


METHOD 1) LEAVE SKIN PLACEHOLDER EMPTY IN SKIN B

When used with pixi-spine the first skin (Skin A with all attachments) works fine. But when switching to skin B (the one with one of the skin placeholders left empty) the attachment stays the same as used in skin A while it should be removed as we've switched to skin B, which doesn't have this attachment. So this doesn't work :(


METHOD 2) ONLY ATTACH THE BONE WITH THE ATTACHMENT TO SKIN A

When used with pixi-spine the first skin (Skin A with all attachments) works fine. But when switching to skin B the attachment of the bone that is only used in skin A remains on screen at the last position before switching to skin B. While this attachment should be gone in skin B as that bone doesn't exist in the skin B :(


So next to above looks like two issues in pixi-spine unfortunately. I'm wondering if in the mean time there is a workaround for having two skins where not all attachments are used in skin B.

Anybody has some clue on how to avoid these issues? Is there perhaps a way to reload all attachments and get rid of unused attachments when switching to another skin? Like a refresh? (hopefully without flashing)

Or is there perhaps something I'm missing here? Am I using wrong methods to accomplish this? Is there a better/right way?

Thanks in advance!

bencresty avatar Nov 15 '21 21:11 bencresty

Sorry, you have to ask this at esotericsoftware forums. The only thing you can take from pixi is hackTextureBySlot, look it in examples folder of this repo.

For more help on pixi, please look in main pixi repo, as i dont currently work on pixi & plugins.

ivanpopelyshev avatar Nov 15 '21 21:11 ivanpopelyshev

@ivanpopelyshev alright I'll do that, but for now I've solved it by just loading a 1x1px transparent image in the skin that shouldn't display the attachment.

Sometimes the most simple workarounds are the fastest to realize, haha :)

bencresty avatar Nov 15 '21 22:11 bencresty