Reputation: 6119
I seem to be having trouble adding a CCLabelTTF on top of an animated CCSprite. I am basically trying to add it to my sprite by using [self.sprite addChild:label]
. This crashes with an error:
Terminating app due to uncaught exception 'NSInternalInconsistencyException',
reason: 'CCSprite is not using the same texture id'
How can I simply put a label on top of my sprite? Thanks
Upvotes: 0
Views: 234
Reputation: 4732
I'm not shure what exacely going wrong in your code, but You may try to add your CCSprite to CCNode, and then, add CCLabelTTF to this node. Than, you may run any frame-changing animation on your sprite, and any rotate/move etc animations on this node: sprite and label will move sinchronizely.
Upvotes: 1
Reputation: 9079
Your animation is probably a CCSpriteBatchNode, you cant add a sprite to a CCSpriteBatchNode child or to a CCSpriteBatchNode if the sprite does not have the same texture. You canot either add self.sprite to a node (since it is already a child of the batchNode). I guess that leaves you with
Upvotes: 1