I'm not sure I fully understand your problem. From what I gather, you want to link the visibility of the attachment (the transparent pixel image) to the visibility of the Pixi Container.
The slot object feature does not handle this automatically. However, you can achieve it by providing a custom afterUpdateWorldTransforms
method.
Here’s how you can do it:
const slot = spineObject.skeleton.findSlot("empty");
spineObject.afterUpdateWorldTransforms = () => pixiObject.visible = Boolean(slot.attachment);
In this code, pixiObject
refers to the container you added using addSlotObject
.
By adding this snippet, the container's visibility will always stay in sync with whether the slot has an attachment or not.
If I did not understand you question, please write your message in your own language. The forum has an auto translate button that works pretty well.