Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p>If I am going to have more than a particle system with different textures. Should I create a zwoptext with them? If so, how?</p> </blockquote> <p>A texture sheet might improve the performance for rendering, because it would not change OpenGL ES state (binding textures). Please take a look at "<a href="http://www.raywenderlich.com/2361/how-to-create-and-optimize-sprite-sheets-in-cocos2d-with-texture-packer-and-pixel-formats" rel="noreferrer">How to Create and Optimize Sprite Sheets in Cocos2D with Texture Packer and Pixel Formats</a>". I strongly recommend you to use <a href="http://www.texturepacker.com/" rel="noreferrer">TexturePacker</a> to create texture sheets.</p> <blockquote> <p>Why do the examples do [[CCTextureCache sharedTextureCache] addImage: @"file"];? it's because it's not added two times?</p> </blockquote> <p>It is easy to use for loading OpenGL texture. You must not use OpenGL ES API such as glTexImage2D or so forth. Also, of course, CCTextureCache always caches textures. It returns immediately CCTexture2D instance if the specified file is already cached.</p> <p><strong>EDIT:</strong></p> <p>You can get CCTexture2D instance from CCSpriteFrameCache with zwoptext plist.</p> <pre><code>CCSpriteFrameCache *frameCache = [CCSpriteFrameCache sharedSpriteFrameCache]; [frameCache addSpriteFramesWithFile:@"textures.plist"]; CCSpriteFrame *frameFire = [frameCache spriteFrameByName:@"particle_fire"]; CCTexture2D *texFire = frameFire.texture; ... glBindTexture(GL_TEXTURE_2D, texFire.name); /* You may need to use frameFire.rectInPixels and frameFire.rotated for the texture coordinates. */ ... CCSpriteFrame *frameWater = [frameCache spriteFrameByName:@"particle_water"]; CCTexture2D *texWater = frameWater.texture; ... glBindTexture(GL_TEXTURE_2D, texWater.name); ... </code></pre>
    singulars
    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.
 

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