Search code examples
javaandroidrefreshspritecocos2d-android

refreshing a sprite in cocos2d android


How do I refresh a sprite without recreating it? like my health meter is getting overlapped by freshly created sprites how do I keep the health meter on top of everything without having to destroy and recreate it? I'm using the cocos2d library for android.


Solution

  • Cocos2D uses the z value of children in a layer to order them, just set the z value of the health meter to a value greater than all the other sprites your using.