mirror of https://github.com/axmolengine/axmol.git
120 lines
3.3 KiB
Plaintext
120 lines
3.3 KiB
Plaintext
enum {
|
|
kCCParticleDurationInfinity = -1,
|
|
kCCParticleStartSizeEqualToEndSize = -1,
|
|
kCCParticleStartRadiusEqualToEndRadius = -1,
|
|
kParticleStartSizeEqualToEndSize = kCCParticleStartSizeEqualToEndSize,
|
|
kParticleDurationInfinity = kCCParticleDurationInfinity,
|
|
};
|
|
|
|
enum {
|
|
kCCParticleModeGravity,
|
|
kCCParticleModeRadius,
|
|
};
|
|
|
|
typedef enum {
|
|
kCCPositionTypeFree,
|
|
kCCPositionTypeRelative,
|
|
kCCPositionTypeGrouped,
|
|
}tCCPositionType;
|
|
|
|
enum {
|
|
kPositionTypeFree = kCCPositionTypeFree,
|
|
kPositionTypeGrouped = kCCPositionTypeGrouped,
|
|
};
|
|
|
|
class CCParticleSystem : public CCNode
|
|
{
|
|
// mode A
|
|
const CCPoint& getGravity();
|
|
void setGravity(const CCPoint& g);
|
|
float getSpeed();
|
|
void setSpeed(float speed);
|
|
float getSpeedVar();
|
|
void setSpeedVar(float speed);
|
|
float getTangentialAccel();
|
|
void setTangentialAccel(float t);
|
|
float getTangentialAccelVar();
|
|
void setTangentialAccelVar(float t);
|
|
float getRadialAccel();
|
|
void setRadialAccel(float t);
|
|
float getRadialAccelVar();
|
|
void setRadialAccelVar(float t);
|
|
|
|
// mode B
|
|
float getStartRadius();
|
|
void setStartRadius(float startRadius);
|
|
float getStartRadiusVar();
|
|
void setStartRadiusVar(float startRadiusVar);
|
|
float getEndRadius();
|
|
void setEndRadius(float endRadius);
|
|
float getEndRadiusVar();
|
|
void setEndRadiusVar(float endRadiusVar);
|
|
float getRotatePerSecond();
|
|
void setRotatePerSecond(float degrees);
|
|
float getRotatePerSecondVar();
|
|
void setRotatePerSecondVar(float degrees);
|
|
|
|
bool addParticle();
|
|
void initParticle(tCCParticle* particle);
|
|
void stopSystem();
|
|
void resetSystem();
|
|
bool isFull();
|
|
void updateQuadWithParticle(tCCParticle* particle, const CCPoint& newPosition);
|
|
void postStep();
|
|
|
|
float getStartSize();
|
|
float getStartSizeVar();
|
|
float getEndSize();
|
|
float getEndSizeVar();
|
|
const ccColor4F & getStartColor();
|
|
const ccColor4F & getStartColorVar();
|
|
const ccColor4F & getEndColor();
|
|
const ccColor4F & getEndColorVar();
|
|
float getStartSpin();
|
|
float getStartSpinVar();
|
|
float getEndSpin();
|
|
float getEndSpinVar();
|
|
float getEmissionRate();
|
|
unsigned int getTotalParticles();
|
|
|
|
bool isAutoRemoveOnFinish();
|
|
void setAutoRemoveOnFinish(bool var);
|
|
int getEmitterMode();
|
|
void setEmitterMode(int mode);
|
|
|
|
CCTexture2D* getTexture(void);
|
|
void setTexture(CCTexture2D* var);
|
|
|
|
ccBlendFunc getBlendFunc(void);
|
|
void setBlendFunc(ccBlendFunc var);
|
|
|
|
void setScale(float s);
|
|
void setRotation(float newRotation);
|
|
void setScaleX(float newScaleX);
|
|
void setScaleY(float newScaleY);
|
|
|
|
bool isActive();
|
|
bool isBlendAdditive();
|
|
void setBlendAdditive(bool value);
|
|
|
|
static CCParticleSystem * create(const char *plistFile);
|
|
};
|
|
|
|
class CCParticleSystemQuad : public CCParticleSystem
|
|
{
|
|
void postStep();
|
|
void setDisplayFrame(CCSpriteFrame* spriteFrame);
|
|
void setTexture(CCTexture2D* texture);
|
|
void setTextureWithRect(CCTexture2D *texture, const CCRect& rect);
|
|
void setBatchNode(CCParticleBatchNode* batchNode);
|
|
void setTotalParticles(unsigned int tp);
|
|
|
|
void updateQuadWithParticle(tCCParticle* particle, const CCPoint& newPosition);
|
|
void postStep();
|
|
void setTotalParticles(unsigned int tp);
|
|
|
|
static CCParticleSystemQuad * create();
|
|
static CCParticleSystemQuad * create(const char *plistFile);
|
|
};
|
|
|