Loading texture

Loading texture
0.0 0


hi wangda & everybody.
In a Scene I want to use many animate texture,I am worry about the performance,So I decide to use a loading scene.
the question is: 1:how do I use the texture what I have loaded in loading scene In other layer or scene?
2:If my CCSprite has many animate action,which should I use, ccspritesheet or ccspritebatchnode ?

  1. call @ CCTextureCache::sharedTextureCache()->addImage(“MyTexture.png”); @ to preload images into CCTextureCache. So next time you use @ CCSprite::initWithFile(“MyTexture.png”) @ to create a sprite, it will use the exiting texture in the cache
  2. CCSpriteSheet is replaced by CCSpriteBatchNode since cocos2d-iphone 0.9.x. It can definitely improve your performance if you have more than 30 sprites in one frame. But CCSpriteBatchNode can not optimize the situation that you have “many animates between different frames”.


very helpful.thanks a lot!