CCSpriteBatchNode Class Reference
| Inherits from | CCNode : CCResponder : NSObject |
| Conforms to | CCBlendProtocol CCTextureProtocol |
| Declared in | CCSpriteBatchNode.h |
Overview
A CCSpriteBatchNode offers improved rendering performance for multiple sprite rendering by utilising a single OpenGL call to render all sprites from one (and only one) texture (one image file, one texture atlas), often knows as a ‘batch draw’.
Notes
- Only CCSprites or any subclass of CCSprite may be added to the CCSpriteBatchNode.
- All CCSprites must reference the same texture atlas.
- Default child capacity is 29 children and will be increased by 33% at runtime each time capacity is reached.
Class Methods
Instance Methods
initWithFile:capacity:
Creates and returns a batch node with the specified texture and capacity values.
- (id)initWithFile:(NSString *)fileImage capacity:(NSUInteger)capacityParameters
- fileImage
Image file name.
- capacity
Initial capacity.
Return Value
An initialized CCSpriteBatchNode Object.
Declared In
CCSpriteBatchNode.hinitWithTexture:capacity:
Creates and returns a batch node with the specified texture and capacity values.
- (id)initWithTexture:(CCTexture *)tex capacity:(NSUInteger)capacityParameters
- tex
Texture to use.
- capacity
Initial capacity.
Return Value
An initialized CCSpriteBatchNode Object.
Declared In
CCSpriteBatchNode.h