ZhouWeikuan / cocos2d

cocos2d for android, based on cocos2d-android-0.82, and now ported from cocos2d-iphone 0.99.4. The googlecode address is here: http://code.google.com/p/cocos2d-android-1/ . There are several demos to watch.
610 stars 291 forks source link

CCRenderTexture disappears after pressing the home button #57

Open Trurl101 opened 12 years ago

Trurl101 commented 12 years ago

I create a CCRenderTexture (inTexture) and put this texture into a Sprite (cardSprite)

cardSprite = CCSprite.sprite(inTexture.getSprite().getTexture());

This works fine in the game. But when I press the home button and go back to the game the Texture has disappeared. If I use a normale Texture (for example the texture of another I sprite initalised with a png-Texture) then the Texture don't disappear.

So it seems that there is a bug in CCRendertexture that makes this texture disappear after resume.

Trurl101 commented 12 years ago

Instead of using multiple small CCRendertextures I use a big one now and it seems that this works better.

Warning: You use CCRenderTexture only after the opengl-Scene has been fully build (onenter), otherwise the app will crash.