• Runtimes
  • how to make and exchange external attachment on cocos2d-x

hi.

CCSkeletonAnimation seems like to not be able to add external attachment.

it seems like only use from atlas.

how can i use external attachment..

for example! how do i do if i want load "aaa.png" and change to "right hand item" on "goblin.spine"

thx...have a good day..

Related Discussions
...
  • Modificato

i have one more question about below code

that code is Skin_getAttachment function

i wonder why need slotIndex.

it looks like attachment is dependent on slot.

thx. have a good day..

Attachment* Skin_getAttachment (const Skin* self, int slotIndex, const char* name) {
	const _Entry* entry = SUB_CAST(_Internal, self) ->entries;
	while (entry) {
		if (entry->slotIndex == slotIndex && strcmp(entry->name, name) == 0) return entry->attachment;
		entry = entry->next;
	}
	return 0;
}