本文来自http://blog.csdn.net/runaying ,引用必须注明出处!
cocos2d-x节点(CCParticleExamples.h)API
温馨提醒:为了大家能更好学习,强烈推荐大家看看本人的这篇博客 Cocos2d-X权威指南笔记
许多个粒子系统的 examples ,下雪,太阳,火焰,烟雾,流行,星系......
///cocos2d-x-3.0alpha0/cocos2dx/particle_nodes
//许多个粒子系统的 examples ,下雪,太阳,火焰,烟雾,流行,星系......
#ifndef __CCPARTICLE_EXAMPLE_H__
#define __CCPARTICLE_EXAMPLE_H__
#include "CCParticleSystemQuad.h"
NS_CC_BEGIN
/**
* @addtogroup particle_nodes
* @{
*/
//! @brief 一个火焰粒子系统
class CC_DLL ParticleFire : public ParticleSystemQuad
{
public:
/**
* @js ctor
*/
ParticleFire(){}
/**
* @js NA
* @lua NA
*/
virtual ~ParticleFire(){}
bool init(){ return initWithTotalParticles(250); }
virtual bool initWithTotalParticles(unsigned int numberOfParticles);
static ParticleFire* create();
static ParticleFire* createWithTotalParticles(unsigned int numberOfParticles);
};
//! @brief 一个烟花粒子系统
class CC_DLL ParticleFireworks : public ParticleSystemQuad
{
public:
/**
* @js ctor
*/
ParticleFireworks(){}
/**
* @js NA
* @lua NA
*/
virtual ~ParticleFireworks(){}
bool init(){ return initWithTotalParticles(1500); }
virtual bool initWithTotalParticles(unsigned int numberOfParticles);
static ParticleFireworks* create();
static ParticleFireworks* createWithTotalParticles(unsigned int numberOfParticles);
};
//! @brief 一个阳光粒子系统
class CC_DLL ParticleSun : public ParticleSystemQuad
{
public:
/**
* @js ctor
*/
ParticleSun(){}
/**
* @js NA
* @lua NA
*/
virtual ~ParticleSun(){}
bool init(){ return initWithTotalParticles(350); }
virtual bool initWithTotalParticles(unsigned int numberOfParticles);
static ParticleSun* create();
static ParticleSun* createWithTotalParticles(unsigned int numberOfParticles);
};
//! @brief 一个星系颗粒系统
class CC_DLL ParticleGalaxy : public ParticleSystemQuad
{
public:
/**
* @js ctor
*/
ParticleGalaxy(){}
/**
* @js NA
* @lua NA
*/
virtual ~ParticleGalaxy(){}
bool init(){ return initWithTotalParticles(200); }
virtual bool initWithTotalParticles(unsigned int numberOfParticles);
static ParticleGalaxy* create();
static ParticleGalaxy* createWithTotalParticles(unsigned int numberOfParticles);
};
//! @brief 一个鲜花粒子系统
class CC_DLL ParticleFlower : public ParticleSystemQuad
{
public:
/**
* @js ctor
*/
ParticleFlower(){}
/**
* @js NA
* @lua NA
*/
virtual ~ParticleFlower(){}
bool init(){ return initWithTotalParticles(250); }
virtual bool initWithTotalParticles(unsigned int numberOfParticles);
static ParticleFlower* create();
static ParticleFlower* createWithTotalParticles(unsigned int numberOfParticles);
};
//! @brief 一颗流星粒子系统
class CC_DLL ParticleMeteor : public ParticleSystemQuad
{
public:
/**
* @js ctor
*/
ParticleMeteor(){}
/**
* @js NA
* @lua NA
*/
virtual ~ParticleMeteor(){}
bool init(){ return initWithTotalParticles(150); }
virtual bool initWithTotalParticles(unsigned int numberOfParticles);
static ParticleMeteor * create();
static ParticleMeteor* createWithTotalParticles(unsigned int numberOfParticles);
};
//! @brief 一个螺旋粒子系统
class CC_DLL ParticleSpiral : public ParticleSystemQuad
{
public:
/**
* @js ctor
*/
ParticleSpiral(){}
/**
* @js NA
* @lua NA
*/
virtual ~ParticleSpiral(){}
bool init(){ return initWithTotalParticles(500); }
virtual bool initWithTotalParticles(unsigned int numberOfParticles);
static ParticleSpiral* create();
static ParticleSpiral* createWithTotalParticles(unsigned int numberOfParticles);
};
//! @brief 爆炸粒子系统
class CC_DLL ParticleExplosion : public ParticleSystemQuad
{
public:
/**
* @js ctor
*/
ParticleExplosion(){}
/**
* @js NA
* @lua NA
*/
virtual ~ParticleExplosion(){}
bool init(){ return initWithTotalParticles(700); }
virtual bool initWithTotalParticles(unsigned int numberOfParticles);
static ParticleExplosion* create();
static ParticleExplosion* createWithTotalParticles(unsigned int numberOfParticles);
};
//! @brief 一个烟雾粒子系统
class CC_DLL ParticleSmoke : public ParticleSystemQuad
{
public:
/**
* @js ctor
*/
ParticleSmoke(){}
/**
* @js NA
* @lua NA
*/
virtual ~ParticleSmoke(){}
bool init(){ return initWithTotalParticles(200); }
virtual bool initWithTotalParticles(unsigned int numberOfParticles);
static ParticleSmoke* create();
static ParticleSmoke* createWithTotalParticles(unsigned int numberOfParticles);
};
//! @brief 一个下雪粒子系统的
class CC_DLL ParticleSnow : public ParticleSystemQuad
{
public:
/**
* @js ctor
*/
ParticleSnow(){}
/**
* @js NA
* @lua NA
*/
virtual ~ParticleSnow(){}
bool init(){ return initWithTotalParticles(700); }
virtual bool initWithTotalParticles(unsigned int numberOfParticles);
static ParticleSnow* create();
static ParticleSnow* createWithTotalParticles(unsigned int numberOfParticles);
};
//! @brief 一个下雨粒子系统
class CC_DLL ParticleRain : public ParticleSystemQuad
{
public:
/**
* @js ctor
*/
ParticleRain(){}
/**
* @js NA
* @lua NA
*/
virtual ~ParticleRain(){}
bool init(){ return initWithTotalParticles(1000); }
virtual bool initWithTotalParticles(unsigned int numberOfParticles);
static ParticleRain* create();
static ParticleRain* createWithTotalParticles(unsigned int numberOfParticles);
};
// end of particle_nodes group
/// @}
NS_CC_END
#endif //__CCPARTICLE_EXAMPLE_H__