seminz

hi.

runtime for Cocos2d-x can detach slot or bone?

and

it can hide only some slot?

it can do.. where can i do that..

thx..
seminz
  • 記事: 25

Nate

Pass 0 as the attachment name for CCSkeleton setAttachment to clear the attachment for a slot.
アバター
Nate

Nate
  • 記事: 9730

seminz

thx. for your answer..

but i can't understand correctly..

below code is for cocos2d-x

there is no way, because it is only skied if attachmentName is null

i know slot name, but i'can do anything..

could you tell me more information..

thx..
int Skeleton_setAttachment (Skeleton* self, const char* slotName, const char* attachmentName) {
int i;
for (i = 0; i < self->slotCount; ++i) {
Slot *slot = self->slots[i];
if (strcmp(slot->data->name, slotName) == 0) {
Attachment* attachment = Skeleton_getAttachmentForSlotIndex(self, i, attachmentName);
if (!attachment) return 0;
Slot_setAttachment(slot, attachment);
return 1;
}
}
return 0;
}
seminz
  • 記事: 25

Nate

That is not the latest code for Skeleton_setAttachment, see here:
https://github.com/EsotericSoftware/spi ... ton.c#L182
アバター
Nate

Nate
  • 記事: 9730


Return to Runtimes