2011-03-19 10:07:16 +08:00
|
|
|
/****************************************************************************
|
|
|
|
Copyright (c) 2008-2010 Ricardo Quesada
|
2014-01-07 11:25:07 +08:00
|
|
|
Copyright (c) 2010-2012 cocos2d-x.org
|
2011-07-04 19:20:16 +08:00
|
|
|
Copyright (c) 2011 Zynga Inc.
|
2014-01-07 11:25:07 +08:00
|
|
|
Copyright (c) 2013-2014 Chukong Technologies Inc.
|
2011-03-19 10:07:16 +08:00
|
|
|
|
|
|
|
http://www.cocos2d-x.org
|
|
|
|
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
|
|
in the Software without restriction, including without limitation the rights
|
|
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
|
|
all copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
THE SOFTWARE.
|
|
|
|
****************************************************************************/
|
|
|
|
#ifndef __CCPARTICLE_EXAMPLE_H__
|
|
|
|
#define __CCPARTICLE_EXAMPLE_H__
|
|
|
|
|
2014-04-27 01:11:22 +08:00
|
|
|
#include "2d/CCParticleSystemQuad.h"
|
2011-03-19 10:07:16 +08:00
|
|
|
|
2012-04-18 18:43:45 +08:00
|
|
|
NS_CC_BEGIN
|
2010-08-23 14:57:37 +08:00
|
|
|
|
2012-06-20 18:09:11 +08:00
|
|
|
/**
|
|
|
|
* @addtogroup particle_nodes
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
2010-12-28 14:04:28 +08:00
|
|
|
//! @brief A fire particle system
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL ParticleFire : public ParticleSystemQuad
|
2010-12-28 14:04:28 +08:00
|
|
|
{
|
|
|
|
public:
|
2013-11-16 05:14:12 +08:00
|
|
|
static ParticleFire* create();
|
|
|
|
static ParticleFire* createWithTotalParticles(int numberOfParticles);
|
2014-03-21 13:44:29 +08:00
|
|
|
|
|
|
|
CC_CONSTRUCTOR_ACCESS:
|
2013-09-13 16:46:31 +08:00
|
|
|
/**
|
|
|
|
* @js ctor
|
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
ParticleFire(){}
|
2013-09-13 13:52:42 +08:00
|
|
|
/**
|
|
|
|
* @js NA
|
|
|
|
* @lua NA
|
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
virtual ~ParticleFire(){}
|
2014-03-21 13:44:29 +08:00
|
|
|
|
2015-03-15 07:10:08 +08:00
|
|
|
bool init() override { return initWithTotalParticles(250); }
|
2013-11-16 05:14:12 +08:00
|
|
|
virtual bool initWithTotalParticles(int numberOfParticles) override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(ParticleFire);
|
2010-12-28 14:04:28 +08:00
|
|
|
};
|
2010-08-23 14:57:37 +08:00
|
|
|
|
2010-12-28 14:04:28 +08:00
|
|
|
//! @brief A fireworks particle system
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL ParticleFireworks : public ParticleSystemQuad
|
2010-12-28 14:04:28 +08:00
|
|
|
{
|
|
|
|
public:
|
2013-11-16 05:14:12 +08:00
|
|
|
static ParticleFireworks* create();
|
|
|
|
static ParticleFireworks* createWithTotalParticles(int numberOfParticles);
|
2014-03-21 13:44:29 +08:00
|
|
|
|
|
|
|
CC_CONSTRUCTOR_ACCESS:
|
2013-09-13 16:46:31 +08:00
|
|
|
/**
|
|
|
|
* @js ctor
|
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
ParticleFireworks(){}
|
2013-09-13 13:52:42 +08:00
|
|
|
/**
|
|
|
|
* @js NA
|
|
|
|
* @lua NA
|
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
virtual ~ParticleFireworks(){}
|
2014-03-21 13:44:29 +08:00
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
bool init(){ return initWithTotalParticles(1500); }
|
2013-11-16 05:14:12 +08:00
|
|
|
virtual bool initWithTotalParticles(int numberOfParticles);
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(ParticleFireworks);
|
|
|
|
|
2010-12-28 14:04:28 +08:00
|
|
|
};
|
2010-08-23 14:57:37 +08:00
|
|
|
|
2010-12-28 14:04:28 +08:00
|
|
|
//! @brief A sun particle system
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL ParticleSun : public ParticleSystemQuad
|
2010-12-28 14:04:28 +08:00
|
|
|
{
|
|
|
|
public:
|
2013-11-16 05:14:12 +08:00
|
|
|
static ParticleSun* create();
|
|
|
|
static ParticleSun* createWithTotalParticles(int numberOfParticles);
|
2014-03-21 13:44:29 +08:00
|
|
|
|
|
|
|
CC_CONSTRUCTOR_ACCESS:
|
2013-09-13 16:46:31 +08:00
|
|
|
/**
|
|
|
|
* @js ctor
|
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
ParticleSun(){}
|
2013-09-13 13:52:42 +08:00
|
|
|
/**
|
|
|
|
* @js NA
|
|
|
|
* @lua NA
|
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
virtual ~ParticleSun(){}
|
2014-03-21 13:44:29 +08:00
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
bool init(){ return initWithTotalParticles(350); }
|
2013-11-16 05:14:12 +08:00
|
|
|
virtual bool initWithTotalParticles(int numberOfParticles);
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(ParticleSun);
|
|
|
|
|
2010-12-28 14:04:28 +08:00
|
|
|
};
|
2010-08-23 14:57:37 +08:00
|
|
|
|
2010-12-28 14:04:28 +08:00
|
|
|
//! @brief A galaxy particle system
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL ParticleGalaxy : public ParticleSystemQuad
|
2010-12-28 14:04:28 +08:00
|
|
|
{
|
|
|
|
public:
|
2013-11-16 05:14:12 +08:00
|
|
|
static ParticleGalaxy* create();
|
|
|
|
static ParticleGalaxy* createWithTotalParticles(int numberOfParticles);
|
2014-03-21 13:44:29 +08:00
|
|
|
|
|
|
|
CC_CONSTRUCTOR_ACCESS:
|
2013-09-13 16:46:31 +08:00
|
|
|
/**
|
|
|
|
* @js ctor
|
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
ParticleGalaxy(){}
|
2013-09-13 13:52:42 +08:00
|
|
|
/**
|
|
|
|
* @js NA
|
|
|
|
* @lua NA
|
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
virtual ~ParticleGalaxy(){}
|
2014-03-21 13:44:29 +08:00
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
bool init(){ return initWithTotalParticles(200); }
|
2013-11-16 05:14:12 +08:00
|
|
|
virtual bool initWithTotalParticles(int numberOfParticles);
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(ParticleGalaxy);
|
|
|
|
|
2010-12-28 14:04:28 +08:00
|
|
|
};
|
2010-08-23 14:57:37 +08:00
|
|
|
|
2010-12-28 14:04:28 +08:00
|
|
|
//! @brief A flower particle system
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL ParticleFlower : public ParticleSystemQuad
|
2010-12-28 14:04:28 +08:00
|
|
|
{
|
|
|
|
public:
|
2013-11-16 05:14:12 +08:00
|
|
|
static ParticleFlower* create();
|
|
|
|
static ParticleFlower* createWithTotalParticles(int numberOfParticles);
|
2014-03-21 13:44:29 +08:00
|
|
|
|
|
|
|
CC_CONSTRUCTOR_ACCESS:
|
2013-09-13 16:46:31 +08:00
|
|
|
/**
|
|
|
|
* @js ctor
|
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
ParticleFlower(){}
|
2013-09-13 13:52:42 +08:00
|
|
|
/**
|
|
|
|
* @js NA
|
|
|
|
* @lua NA
|
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
virtual ~ParticleFlower(){}
|
2014-03-21 13:44:29 +08:00
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
bool init(){ return initWithTotalParticles(250); }
|
2013-11-16 05:14:12 +08:00
|
|
|
virtual bool initWithTotalParticles(int numberOfParticles);
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(ParticleFlower);
|
2010-12-28 14:04:28 +08:00
|
|
|
};
|
2010-08-23 14:57:37 +08:00
|
|
|
|
2010-12-28 14:04:28 +08:00
|
|
|
//! @brief A meteor particle system
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL ParticleMeteor : public ParticleSystemQuad
|
2010-12-28 14:04:28 +08:00
|
|
|
{
|
|
|
|
public:
|
2013-11-16 05:14:12 +08:00
|
|
|
static ParticleMeteor * create();
|
|
|
|
static ParticleMeteor* createWithTotalParticles(int numberOfParticles);
|
2014-03-21 13:44:29 +08:00
|
|
|
|
|
|
|
CC_CONSTRUCTOR_ACCESS:
|
2013-09-13 16:46:31 +08:00
|
|
|
/**
|
|
|
|
* @js ctor
|
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
ParticleMeteor(){}
|
2013-09-13 13:52:42 +08:00
|
|
|
/**
|
|
|
|
* @js NA
|
|
|
|
* @lua NA
|
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
virtual ~ParticleMeteor(){}
|
2014-03-21 13:44:29 +08:00
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
bool init(){ return initWithTotalParticles(150); }
|
2013-11-16 05:14:12 +08:00
|
|
|
virtual bool initWithTotalParticles(int numberOfParticles);
|
2012-12-06 18:51:33 +08:00
|
|
|
|
2013-11-16 05:14:12 +08:00
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(ParticleMeteor);
|
2010-12-28 14:04:28 +08:00
|
|
|
};
|
2010-08-23 14:57:37 +08:00
|
|
|
|
2010-12-28 14:04:28 +08:00
|
|
|
//! @brief An spiral particle system
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL ParticleSpiral : public ParticleSystemQuad
|
2010-12-28 14:04:28 +08:00
|
|
|
{
|
|
|
|
public:
|
2013-11-16 05:14:12 +08:00
|
|
|
static ParticleSpiral* create();
|
|
|
|
static ParticleSpiral* createWithTotalParticles(int numberOfParticles);
|
2014-03-21 13:44:29 +08:00
|
|
|
|
|
|
|
CC_CONSTRUCTOR_ACCESS:
|
2013-09-13 16:46:31 +08:00
|
|
|
/**
|
|
|
|
* @js ctor
|
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
ParticleSpiral(){}
|
2013-09-13 13:52:42 +08:00
|
|
|
/**
|
|
|
|
* @js NA
|
|
|
|
* @lua NA
|
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
virtual ~ParticleSpiral(){}
|
2014-03-21 13:44:29 +08:00
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
bool init(){ return initWithTotalParticles(500); }
|
2013-11-16 05:14:12 +08:00
|
|
|
virtual bool initWithTotalParticles(int numberOfParticles);
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(ParticleSpiral);
|
|
|
|
|
2010-12-28 14:04:28 +08:00
|
|
|
};
|
2010-08-23 14:57:37 +08:00
|
|
|
|
2010-12-28 14:04:28 +08:00
|
|
|
//! @brief An explosion particle system
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL ParticleExplosion : public ParticleSystemQuad
|
2010-12-28 14:04:28 +08:00
|
|
|
{
|
|
|
|
public:
|
2013-11-16 05:14:12 +08:00
|
|
|
static ParticleExplosion* create();
|
|
|
|
static ParticleExplosion* createWithTotalParticles(int numberOfParticles);
|
2014-03-21 13:44:29 +08:00
|
|
|
|
|
|
|
CC_CONSTRUCTOR_ACCESS:
|
2013-09-13 16:46:31 +08:00
|
|
|
/**
|
|
|
|
* @js ctor
|
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
ParticleExplosion(){}
|
2013-09-13 13:52:42 +08:00
|
|
|
/**
|
|
|
|
* @js NA
|
|
|
|
* @lua NA
|
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
virtual ~ParticleExplosion(){}
|
2014-03-21 13:44:29 +08:00
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
bool init(){ return initWithTotalParticles(700); }
|
2013-11-16 05:14:12 +08:00
|
|
|
virtual bool initWithTotalParticles(int numberOfParticles);
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(ParticleExplosion);
|
2010-12-28 14:04:28 +08:00
|
|
|
};
|
2010-08-23 14:57:37 +08:00
|
|
|
|
2010-12-28 14:04:28 +08:00
|
|
|
//! @brief An smoke particle system
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL ParticleSmoke : public ParticleSystemQuad
|
2010-12-28 14:04:28 +08:00
|
|
|
{
|
|
|
|
public:
|
2013-11-16 05:14:12 +08:00
|
|
|
static ParticleSmoke* create();
|
|
|
|
static ParticleSmoke* createWithTotalParticles(int numberOfParticles);
|
2014-03-21 13:44:29 +08:00
|
|
|
|
|
|
|
CC_CONSTRUCTOR_ACCESS:
|
2013-09-13 16:46:31 +08:00
|
|
|
/**
|
|
|
|
* @js ctor
|
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
ParticleSmoke(){}
|
2013-09-13 13:52:42 +08:00
|
|
|
/**
|
|
|
|
* @js NA
|
|
|
|
* @lua NA
|
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
virtual ~ParticleSmoke(){}
|
2014-03-21 13:44:29 +08:00
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
bool init(){ return initWithTotalParticles(200); }
|
2013-11-16 05:14:12 +08:00
|
|
|
virtual bool initWithTotalParticles(int numberOfParticles);
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(ParticleSmoke);
|
2010-12-28 14:04:28 +08:00
|
|
|
};
|
2010-08-23 14:57:37 +08:00
|
|
|
|
2010-12-28 14:04:28 +08:00
|
|
|
//! @brief An snow particle system
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL ParticleSnow : public ParticleSystemQuad
|
2010-12-28 14:04:28 +08:00
|
|
|
{
|
|
|
|
public:
|
2013-11-16 05:14:12 +08:00
|
|
|
static ParticleSnow* create();
|
|
|
|
static ParticleSnow* createWithTotalParticles(int numberOfParticles);
|
2014-03-21 13:44:29 +08:00
|
|
|
|
|
|
|
CC_CONSTRUCTOR_ACCESS:
|
2013-09-13 16:46:31 +08:00
|
|
|
/**
|
|
|
|
* @js ctor
|
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
ParticleSnow(){}
|
2013-09-13 13:52:42 +08:00
|
|
|
/**
|
|
|
|
* @js NA
|
|
|
|
* @lua NA
|
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
virtual ~ParticleSnow(){}
|
2014-03-21 13:44:29 +08:00
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
bool init(){ return initWithTotalParticles(700); }
|
2013-11-16 05:14:12 +08:00
|
|
|
virtual bool initWithTotalParticles(int numberOfParticles);
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(ParticleSnow);
|
2010-12-28 14:04:28 +08:00
|
|
|
};
|
2010-08-23 14:57:37 +08:00
|
|
|
|
2010-12-28 14:04:28 +08:00
|
|
|
//! @brief A rain particle system
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL ParticleRain : public ParticleSystemQuad
|
2010-12-28 14:04:28 +08:00
|
|
|
{
|
|
|
|
public:
|
2013-11-16 05:14:12 +08:00
|
|
|
static ParticleRain* create();
|
|
|
|
static ParticleRain* createWithTotalParticles(int numberOfParticles);
|
2014-03-21 13:44:29 +08:00
|
|
|
|
|
|
|
CC_CONSTRUCTOR_ACCESS:
|
2013-09-13 16:46:31 +08:00
|
|
|
/**
|
|
|
|
* @js ctor
|
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
ParticleRain(){}
|
2013-09-13 13:52:42 +08:00
|
|
|
/**
|
|
|
|
* @js NA
|
|
|
|
* @lua NA
|
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
virtual ~ParticleRain(){}
|
2014-03-21 13:44:29 +08:00
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
bool init(){ return initWithTotalParticles(1000); }
|
2013-11-16 05:14:12 +08:00
|
|
|
virtual bool initWithTotalParticles(int numberOfParticles);
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(ParticleRain);
|
2010-12-28 14:04:28 +08:00
|
|
|
};
|
2011-03-19 10:07:16 +08:00
|
|
|
|
2012-06-20 18:09:11 +08:00
|
|
|
// end of particle_nodes group
|
|
|
|
/// @}
|
|
|
|
|
2012-04-18 18:43:45 +08:00
|
|
|
NS_CC_END
|
2011-03-19 10:07:16 +08:00
|
|
|
|
|
|
|
#endif //__CCPARTICLE_EXAMPLE_H__
|