Adding in Particle Systems to Lua Bindings (inc. the example systems.)

This commit is contained in:
ciaranj 2011-09-17 22:24:28 +01:00
parent 3e93a49b3c
commit 209214008e
3 changed files with 130 additions and 1 deletions

View File

@ -1 +1 @@
81db7d53c6481b5b3697cf69fc99d106438eb0bd
08a6fb8c95775f5f4aeb25def379a741f6ea56f0

View File

@ -0,0 +1,127 @@
namespace cocos2d {
class CCParticleSystem : public CCNode, public CCTextureProtocol {
CCParticleSystem();
static CCParticleSystem * particleWithFile(const char *plistFile);
bool initWithFile(const char *plistFile);
bool initWithDictionary(CCDictionary<std::string, CCObject*> *dictionary);
bool initWithTotalParticles(unsigned int numberOfParticles);
// 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();
void update(ccTime dt);
CCTexture2D* getTexture(void);
void setTexture(CCTexture2D* var);
ccBlendFunc getBlendFunc(void);
void setBlendFunc(ccBlendFunc var);
};
// Inheritance is funky here in the examples.... in reality its a pragma-def .. not sure how to map that?
class CCParticleFire : public CCParticleSystem {
CCParticleFire();
bool init();
bool initWithTotalParticles(unsigned int numberOfParticles);
static CCParticleFire *node(void);
};
class CCParticleFireworks : public CCParticleSystem {
CCParticleFireworks();
bool init();
bool initWithTotalParticles(unsigned int numberOfParticles);
static CCParticleFireworks *node(void);
};
class CCParticleSun : public CCParticleSystem {
CCParticleSun();
bool init();
bool initWithTotalParticles(unsigned int numberOfParticles);
static CCParticleSun *node(void);
};
class CCParticleGalaxy : public CCParticleSystem {
CCParticleGalaxy();
bool init();
bool initWithTotalParticles(unsigned int numberOfParticles);
static CCParticleGalaxy *node(void);
};
class CCParticleMeteor : public CCParticleSystem {
CCParticleMeteor();
bool init();
bool initWithTotalParticles(unsigned int numberOfParticles);
static CCParticleMeteor *node(void);
};
class CCParticleSpiral : public CCParticleSystem {
CCParticleSpiral();
bool init();
bool initWithTotalParticles(unsigned int numberOfParticles);
static CCParticleSpiral *node(void);
};
class CCParticleExplosion : public CCParticleSystem {
CCParticleExplosion();
bool init();
bool initWithTotalParticles(unsigned int numberOfParticles);
static CCParticleExplosion *node(void);
};
class CCParticleSmoke : public CCParticleSystem {
CCParticleSmoke();
bool init();
bool initWithTotalParticles(unsigned int numberOfParticles);
static CCParticleSmoke *node(void);
};
class CCParticleSnow : public CCParticleSystem {
CCParticleSnow();
bool init();
bool initWithTotalParticles(unsigned int numberOfParticles);
static CCParticleSnow *node(void);
};
class CCParticleRain : public CCParticleSystem {
CCParticleRain();
bool init();
bool initWithTotalParticles(unsigned int numberOfParticles);
static CCParticleRain *node(void);
};
} // namespace

View File

@ -114,4 +114,6 @@ $pfile "CCMenu.pkg"
$pfile "CCMenuItem.pkg"
$pfile "CCMotionStreak.pkg"
$pfile "CCParticleSystem.pkg"
$pfile "CCCommon.pkg"