Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You are right about CCSpriteBatchNode. CCSpriteBatchNode is like a batch node: if it contains children, it will draw them in 1 single OpenGL call (often known as "batch draw"), in absence of CCSpriteBatchNode (in this case) all the "batch draw" will be called as many time as number of children (sprites).</p> <p>A CCSpriteBatchNode can reference one and only one texture (one image file, one texture atlas) i.e. sprite sheet created by zwoptex. Only the CCSprites that are contained in that texture can be added to the CCSpriteBatchNode. All CCSprites added to a CCSpriteBatchNode are drawn in one OpenGL ES draw call. If the CCSprites are not added to a CCSpriteBatchNode then an OpenGL ES draw call will be needed for each one, which is less efficient.</p> <p>According to your scenario, you don't have to use CCSpriteBatchNode since there is only one texture rendered at any given time.</p> <blockquote> <p>So I want to know: Should I animate the sprite frame by frame (no huge texture)? Or is it possible to use that huge texture but in a different way?</p> </blockquote> <p>It doesn't matter. You will be loading the 2048 x 2048 texture anyways. The issue to ponder is why only one 2048 x 2048 texture is giving you a Level 2 warning? how many such textures are you loading. BTW 2048 x 2048 is only supported on iPod3G/iPhone3GS above (which is fine).</p> <p>In case you are loading many textures (which seems true to me). You need to program some logic where you can unload the texture when they are not necessary. Do look at the following methods:</p> <pre><code>[[CCSpriteFrameCache sharedSpriteFrameCache] removeSpriteFramesFromFile:fileName]; [[CCSpriteFrameCache sharedSpriteFrameCache] removeUnusedSpriteFrames]; [[CCTextureCache sharedTextureCache] removeUnusedTextures]; </code></pre> <p>As far as animation is concerned you can create CCAnimation and use that or (depending upon your scenario) you can use setDisplayFrame(CCSpriteFrame frame); </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload