Hi, how can I add a child (an emitter in my case) to a spine model? I can obtain a slot, but it’s not a Node class object.
You can’t… but what you can do is update the child position to the slot.
But how can I find a slot position? Here’s a definition of slot:
typedef struct spSlotData {
const int index;
const char* const name;
const spBoneData* const boneData;
const char* attachmentName;
float r, g, b, a;
spBlendMode blendMode;
#ifdef __cplusplus
spSlotData() :
index(0),
name(0),
boneData(0),
attachmentName(0),
r(0), g(0), b(0), a(0),
blendMode(SP_BLEND_MODE_NORMAL) {
}
#endif
} spSlotData;
Ok I’ve found something like this:
slot->boneData->x
slot->boneData->y
But even when playing animation slot is moving it’s still returning the same result.
I used it like this
spBone *gun;
shoot()
{
gun = spSkeleton_findBone(enemySprite->getSkeleton(), “gun1”);
gun->worldX;
gun->worldY;
}
1 Like
So there’s bone and boneData…
Thanks for help!