![]() |
cocos2d-iphone
2.1
Improved Cocos2D API Reference (iOS version) for www.kobold2d.com developers
|
#import <CCParticleBatchNode.h>
Public Member Functions | |
(id) | - initWithTexture:capacity: |
(id) | - initWithFile:capacity: |
(void) | - addChild:z:tag: |
(void) | - insertChild:inAtlasAtIndex: |
(void) | - removeChild:cleanup: |
(void) | - disableParticle: |
Static Public Member Functions | |
(id) | + batchNodeWithTexture: |
(id) | + batchNodeWithFile: |
(id) | + batchNodeWithTexture:capacity: |
(id) | + batchNodeWithFile:capacity: |
Protected Attributes | |
CCTextureAtlas * | _textureAtlas |
ccBlendFunc | _blendFunc |
Properties | |
CCTextureAtlas * | textureAtlas |
ccBlendFunc | blendFunc |
CCParticleBatchNode is like a batch node: if it contains children, it will draw them in 1 single OpenGL call (often known as "batch draw").
A CCParticleBatchNode can reference one and only one texture (one image file, one texture atlas). Only the CCParticleSystems that are contained in that texture can be added to the CCSpriteBatchNode. All CCParticleSystems added to a CCSpriteBatchNode are drawn in one OpenGL ES draw call. If the CCParticleSystems are not added to a CCParticleBatchNode then an OpenGL ES draw call will be needed for each one, which is less efficient.
Limitations:
Most efficient usage
- (void) addChild: | (CCParticleSystem *) | child | |
z: | (NSInteger) | z | |
tag: | (NSInteger) | aTag | |
Add a child into the CCParticleBatchNode
+ (id) batchNodeWithFile: | (NSString *) | imageFile |
initializes the particle system with the name of a file on disk (for a list of supported formats look at the CCTexture2D class), a default capacity of 500 particles
+ (id) batchNodeWithFile: | (NSString *) | fileImage | |
capacity: | (NSUInteger) | capacity | |
initializes the particle system with the name of a file on disk (for a list of supported formats look at the CCTexture2D class), a capacity of particles
+ (id) batchNodeWithTexture: | (CCTexture2D *) | tex |
initializes the particle system with CCTexture2D, a default capacity of 500
+ (id) batchNodeWithTexture: | (CCTexture2D *) | tex | |
capacity: | (NSUInteger) | capacity | |
initializes the particle system with CCTexture2D, a capacity of particles, which particle system to use
- (void) disableParticle: | (NSUInteger) | particleIndex |
disables a particle by inserting a 0'd quad into the texture atlas
- (id) initWithFile: | (NSString *) | fileImage | |
capacity: | (NSUInteger) | capacity | |
initializes the particle system with the name of a file on disk (for a list of supported formats look at the CCTexture2D class), a capacity of particles
- (id) initWithTexture: | (CCTexture2D *) | tex | |
capacity: | (NSUInteger) | capacity | |
initializes the particle system with CCTexture2D, a capacity of particles
- (void) insertChild: | (CCParticleSystem *) | pSystem | |
inAtlasAtIndex: | (NSUInteger) | index | |
Inserts a child into the CCParticleBatchNode
- (void) removeChild: | (CCParticleSystem *) | pSystem | |
cleanup: | (BOOL) | doCleanUp | |
remove child from the CCParticleBatchNode
- (ccBlendFunc) blendFunc [read, write, assign] |
the blend function used for drawing the quads
- (CCTextureAtlas*) textureAtlas [read, write, retain] |
the texture atlas used for drawing the quads