how to re-use a sprite in cocos2d-x
Posted
by
zinking
on Game Development
See other posts from Game Development
or by zinking
Published on 2013-05-25T14:51:11Z
Indexed on
2013/06/25
22:30 UTC
Read the original article
Hit count: 517
some times it takes time to create the sprite structures in the scene, I might need to setup structures inside this sprite to meet requirement, thus I would hope to reuse such structures with the game again and again.
I tried that, remove the child from parent, detach it from parent , clean parent with the sprite. but when I try to add the sprite to another scene, it's just wont pass the assertion that the sprite already have parent
did I miss some step ?
add an example:
I have a sprite A which involves of quite a few steps to construct, so I used it in scene A layer A, and then I want to use it in scene A layer B, scene B layer A1 etc..... generally speaking I don't want to reconstruct the sprte again.
© Game Development or respective owner