|
cocos2d-iphone
2.1
Improved Cocos2D API Reference (iOS version) for www.koboldtouch.com developers
|
#import <CCParticleSystem.h>
Instance Methods | |
| (id) | - initWithFile: |
| (id) | - initWithDictionary: |
| (id) | - initWithDictionary:path: |
| (id) | - initWithTotalParticles: |
| Initializes a system with a fixed number of particles. More... | |
| (void) | - stopSystem |
| stop emitting particles. Running particles will continue to run until they die More... | |
| (void) | - resetSystem |
| Kill all living particles. More... | |
| (BOOL) | - isFull |
| whether or not the system is full More... | |
| (void) | - updateQuadWithParticle:newPosition: |
| should be overriden by subclasses More... | |
| (void) | - postStep |
| should be overriden by subclasses More... | |
| (void) | - update: |
| called in every loop. More... | |
| (void) | - updateWithNoTime |
| Instance Methods inherited from CCNode | |
| (id) | - init |
| (void) | - onEnter |
| (void) | - onEnterTransitionDidFinish |
| (void) | - onExit |
| (void) | - onExitTransitionDidStart |
| (void) | - addChild: |
| (void) | - addChild:z: |
| (void) | - addChild:z:tag: |
| (void) | - removeFromParent |
| (void) | - removeFromParentAndCleanup: |
| (void) | - removeChild: |
| (void) | - removeChild:cleanup: |
| (void) | - removeChildByTag: |
| (void) | - removeChildByTag:cleanup: |
| (void) | - removeAllChildren |
| (void) | - removeAllChildrenWithCleanup: |
| (CCNode *) | - getChildByTag: |
| (void) | - reorderChild:z: |
| (void) | - sortAllChildren |
| (void) | - cleanup |
| (void) | - draw |
| (void) | - visit |
| (void) | - transform |
| (void) | - transformAncestors |
| (CGRect) | - boundingBox |
| (CCAction *) | - runAction: |
| (void) | - stopAllActions |
| (void) | - stopAction: |
| (void) | - stopActionByTag: |
| (CCAction *) | - getActionByTag: |
| (NSUInteger) | - numberOfRunningActions |
| (void) | - scheduleUpdate |
| (void) | - scheduleUpdateWithPriority: |
| (void) | - unscheduleUpdate |
| (void) | - schedule: |
| (void) | - schedule:interval: |
| (void) | - schedule:interval:repeat:delay: |
| (void) | - scheduleOnce:delay: |
| (void) | - unschedule: |
| (void) | - unscheduleAllSelectors |
| (void) | - resumeSchedulerAndActions |
| (void) | - pauseSchedulerAndActions |
| (CGAffineTransform) | - nodeToParentTransform |
| (CGAffineTransform) | - parentToNodeTransform |
| (CGAffineTransform) | - nodeToWorldTransform |
| (CGAffineTransform) | - worldToNodeTransform |
| (CGPoint) | - convertToNodeSpace: |
| (CGPoint) | - convertToWorldSpace: |
| (CGPoint) | - convertToNodeSpaceAR: |
| (CGPoint) | - convertToWorldSpaceAR: |
| (CGPoint) | - convertTouchToNodeSpace: |
| (CGPoint) | - convertTouchToNodeSpaceAR: |
| (void) | - setIsRelativeAnchorPoint: |
| (BOOL) | - DEPRECATED_ATTRIBUTE |
| (void) | - setZOrder: |
| Instance Methods inherited from <CCTextureProtocol> | |
| (CCTexture2D *) | - texture |
| (void) | - setTexture: |
| Instance Methods inherited from <CCBlendProtocol> | |
| (void) | - setBlendFunc: |
| (ccBlendFunc) | - blendFunc |
Class Methods | |
| (id) | + particleWithFile: |
| (id) | + particleWithTotalParticles: |
| Class Methods inherited from CCNode | |
| (id) | + node |
Protected Attributes | |
| BOOL | _active |
| float | _duration |
| float | _elapsed |
| CGPoint | _sourcePosition |
| CGPoint | _posVar |
| float | _angle |
| float | _angleVar |
| NSInteger | _emitterMode |
| union { | |
| struct { | |
| CGPoint gravity | |
| float speed | |
| float speedVar | |
| float tangentialAccel | |
| float tangentialAccelVar | |
| float radialAccel | |
| float radialAccelVar | |
| } A | |
| struct { | |
| float startRadius | |
| float startRadiusVar | |
| float endRadius | |
| float endRadiusVar | |
| float rotatePerSecond | |
| float rotatePerSecondVar | |
| } B | |
| } | _mode |
| float | _startSize |
| float | _startSizeVar |
| float | _endSize |
| float | _endSizeVar |
| float | _life |
| float | _lifeVar |
| ccColor4F | _startColor |
| ccColor4F | _startColorVar |
| ccColor4F | _endColor |
| ccColor4F | _endColorVar |
| float | _startSpin |
| float | _startSpinVar |
| float | _endSpin |
| float | _endSpinVar |
| tCCParticle * | _particles |
| NSUInteger | _totalParticles |
| NSUInteger | _particleCount |
| NSUInteger | _allocatedParticles |
| float | _emissionRate |
| float | _emitCounter |
| CCTexture2D * | _texture |
| ccBlendFunc | _blendFunc |
| BOOL | _opacityModifyRGB |
| tCCPositionType | _positionType |
| BOOL | _autoRemoveOnFinish |
| NSUInteger | _particleIdx |
| CC_UPDATE_PARTICLE_IMP | _updateParticleImp |
| SEL | _updateParticleSel |
| CCParticleBatchNode * | _batchNode |
| NSUInteger | _atlasIndex |
| BOOL | _transformSystemDirty |
| Protected Attributes inherited from CCNode | |
| float | _rotationX |
| float | _rotationY |
| float | _scaleX |
| float | _scaleY |
| float | _vertexZ |
| CGPoint | _position |
| float | _skewX |
| float | _skewY |
| CGPoint | _anchorPointInPoints |
| CGPoint | _anchorPoint |
| CGSize | _contentSize |
| CGAffineTransform | _transform |
| CGAffineTransform | _inverse |
| BOOL | _isTransformDirty |
| BOOL | _isInverseDirty |
| CCCamera * | _camera |
| CCGridBase * | _grid |
| NSInteger | _zOrder |
| CCArray * | _children |
| CCNode * | _parent |
| NSInteger | _tag |
| void * | _userData |
| id | _userObject |
| CCGLProgram * | _shaderProgram |
| ccGLServerState | _glServerState |
| NSUInteger | _orderOfArrival |
| CCScheduler * | _scheduler |
| CCActionManager * | _actionManager |
| BOOL | _isRunning |
| BOOL | _visible |
| BOOL | _ignoreAnchorPointForPosition |
| BOOL | _isReorderChildDirty |
Particle System base class Attributes of a Particle System:
cocos2d also supports particles generated by Particle Designer (http://particledesigner.71squared.com/). 'Radius Mode' in Particle Designer uses a fixed emit rate of 30 hz. Since that can't be guarateed in cocos2d, cocos2d uses a another approach, but the results are almost identical.
cocos2d supports all the variables used by Particle Designer plus a bit more:
It is possible to customize any of the above mentioned properties in runtime. Example:
| - (id) initWithDictionary: | (NSDictionary *) | dictionary |
initializes a particle system from a NSDictionary.
| - (id) initWithDictionary: | (NSDictionary *) | dictionary | |
| path: | (NSString *) | dirname | |
initializes a particle system from a NSDictionary and the path from where to load the png
| - (id) initWithFile: | (NSString *) | plistFile |
initializes a CCParticleSystem from a plist file. This plist files can be creted manually or with Particle Designer: http://particledesigner.71squared.com/
| - (id) initWithTotalParticles: | (NSUInteger) | numberOfParticles |
Initializes a system with a fixed number of particles.
| - (BOOL) isFull |
whether or not the system is full
| + (id) particleWithFile: | (NSString *) | plistFile |
creates an initializes a CCParticleSystem from a plist file. This plist files can be creted manually or with Particle Designer: http://particledesigner.71squared.com/
| - (void) postStep |
should be overriden by subclasses
| - (void) resetSystem |
Kill all living particles.
| - (void) stopSystem |
stop emitting particles. Running particles will continue to run until they die
| - (void) updateQuadWithParticle: | (tCCParticle *) | particle | |
| newPosition: | (CGPoint) | pos | |
should be overriden by subclasses
|
readnonatomicassign |
Is the emitter active
|
readwritenonatomicassign |
angle and angle variation of each particle
|
readwritenonatomicassign |
angle variance of each particle
|
readwritenonatomicassign |
whether or not the node will be auto-removed when it has no particles left. By default it is NO.
|
readwritenonatomicassign |
weak reference to the CCSpriteBatchNode that renders the CCSprite
|
readwritenonatomicassign |
whether or not the particles are using blend additive. If enabled, the following blending function will be used.
|
readwritenonatomicassign |
conforms to CocosNodeTexture protocol
|
readwritenonatomicassign |
How many seconds the emitter wil run. -1 means 'forever'
|
readwritenonatomicassign |
emission rate of the particles
|
readwritenonatomicassign |
Switch between different kind of emitter modes:
|
readwritenonatomicassign |
end color and end color variation of each particle
|
readwritenonatomicassign |
end color variance of each particle
|
readwritenonatomicassign |
The ending radius of the particles. Only available in 'Radius' mode.
|
readwritenonatomicassign |
The ending radius variance of the particles. Only available in 'Radius' mode.
|
readwritenonatomicassign |
end size in pixels of each particle
|
readwritenonatomicassign |
end size variance in pixels of each particle
|
readwritenonatomicassign |
Gravity value. Only available in 'Gravity' mode.
|
readwritenonatomicassign |
life, and life variation of each particle
|
readwritenonatomicassign |
life variance of each particle
|
readwritenonatomicassign |
does the alpha value modify color
|
readnonatomicassign |
Quantity of particles that are being simulated at the moment
|
readwritenonatomicassign |
particles movement type: Free or Grouped
|
readwritenonatomicassign |
Position variance of the emitter
|
readwritenonatomicassign |
radial acceleration of each particle. Only available in 'Gravity' mode.
|
readwritenonatomicassign |
radial acceleration variance of each particle. Only available in 'Gravity' mode.
|
readwritenonatomicassign |
Number of degress to rotate a particle around the source pos per second. Only available in 'Radius' mode.
|
readwritenonatomicassign |
Variance in degrees for rotatePerSecond. Only available in 'Radius' mode.
|
readwritenonatomicassign |
sourcePosition of the emitter
|
readwritenonatomicassign |
speed of each particle. Only available in 'Gravity' mode.
|
readwritenonatomicassign |
speed variance of each particle. Only available in 'Gravity' mode.
|
readwritenonatomicassign |
start color of each particle
|
readwritenonatomicassign |
start color variance of each particle
|
readwritenonatomicassign |
The starting radius of the particles. Only available in 'Radius' mode.
|
readwritenonatomicassign |
The starting radius variance of the particles. Only available in 'Radius' mode.
|
readwritenonatomicassign |
start size in pixels of each particle
|
readwritenonatomicassign |
size variance in pixels of each particle
|
readwritenonatomicassign |
tangential acceleration of each particle. Only available in 'Gravity' mode.
|
readwritenonatomicassign |
tangential acceleration variance of each particle. Only available in 'Gravity' mode.
|
readwritenonatomicretain |
conforms to CocosNodeTexture protocol
|
readwritenonatomicassign |
maximum particles of the system