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.
|
2018-01-29 16:25:32 +08:00
|
|
|
Copyright (c) 2013-2016 Chukong Technologies Inc.
|
|
|
|
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
|
2011-03-19 10:07:16 +08:00
|
|
|
|
2022-07-09 01:23:11 +08:00
|
|
|
https://axis-project.github.io/
|
2011-03-19 10:07:16 +08:00
|
|
|
|
|
|
|
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
|
|
|
|
2022-07-11 17:50:21 +08:00
|
|
|
NS_AX_BEGIN
|
2010-08-23 14:57:37 +08:00
|
|
|
|
2012-06-20 18:09:11 +08:00
|
|
|
/**
|
2015-03-24 10:34:41 +08:00
|
|
|
* @addtogroup _2d
|
2012-06-20 18:09:11 +08:00
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
2015-03-21 18:02:56 +08:00
|
|
|
/** @class ParticleFire
|
|
|
|
* @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:
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Create a fire particle system.
|
|
|
|
*
|
|
|
|
* @return An autoreleased ParticleFire object.
|
|
|
|
*/
|
2013-11-16 05:14:12 +08:00
|
|
|
static ParticleFire* create();
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Create a fire particle system withe a fixed number of particles.
|
|
|
|
*
|
|
|
|
* @param numberOfParticles A given number of particles.
|
|
|
|
* @return An autoreleased ParticleFire object.
|
2015-03-23 20:27:13 +08:00
|
|
|
* @js NA
|
2015-03-21 18:02:56 +08:00
|
|
|
*/
|
2013-11-16 05:14:12 +08:00
|
|
|
static ParticleFire* createWithTotalParticles(int numberOfParticles);
|
2021-12-25 10:04:45 +08:00
|
|
|
|
2022-03-18 21:46:07 +08:00
|
|
|
/**
|
|
|
|
* @js ctor
|
|
|
|
*/
|
|
|
|
ParticleFire() {}
|
2013-09-13 13:52:42 +08:00
|
|
|
/**
|
|
|
|
* @js NA
|
|
|
|
* @lua NA
|
|
|
|
*/
|
2021-12-25 10:04:45 +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
|
|
|
|
2015-03-21 18:02:56 +08:00
|
|
|
/** @class ParticleFireworks
|
|
|
|
* @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:
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Create a fireworks particle system.
|
|
|
|
*
|
|
|
|
* @return An autoreleased ParticleFireworks object.
|
|
|
|
*/
|
2013-11-16 05:14:12 +08:00
|
|
|
static ParticleFireworks* create();
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Create a fireworks particle system withe a fixed number of particles.
|
|
|
|
*
|
|
|
|
* @param numberOfParticles A given number of particles.
|
|
|
|
* @return An autoreleased ParticleFireworks object.
|
2015-03-23 20:27:13 +08:00
|
|
|
* @js NA
|
2015-03-21 18:02:56 +08:00
|
|
|
*/
|
2013-11-16 05:14:12 +08:00
|
|
|
static ParticleFireworks* createWithTotalParticles(int numberOfParticles);
|
2021-12-25 10:04:45 +08:00
|
|
|
|
2022-03-18 21:46:07 +08:00
|
|
|
/**
|
|
|
|
* @js ctor
|
|
|
|
*/
|
|
|
|
ParticleFireworks() {}
|
2013-09-13 13:52:42 +08:00
|
|
|
/**
|
|
|
|
* @js NA
|
|
|
|
* @lua NA
|
|
|
|
*/
|
2021-12-25 10:04:45 +08:00
|
|
|
virtual ~ParticleFireworks() {}
|
2014-03-21 13:44:29 +08:00
|
|
|
|
2021-12-25 10:04:45 +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
|
|
|
|
2015-03-21 18:02:56 +08:00
|
|
|
/** @class ParticleSun
|
|
|
|
* @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:
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Create a sun particle system.
|
|
|
|
*
|
|
|
|
* @return An autoreleased ParticleSun object.
|
|
|
|
*/
|
2013-11-16 05:14:12 +08:00
|
|
|
static ParticleSun* create();
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Create a sun particle system withe a fixed number of particles.
|
|
|
|
*
|
|
|
|
* @param numberOfParticles A given number of particles.
|
|
|
|
* @return An autoreleased ParticleSun object.
|
2015-03-23 20:27:13 +08:00
|
|
|
* @js NA
|
2015-03-21 18:02:56 +08:00
|
|
|
*/
|
2013-11-16 05:14:12 +08:00
|
|
|
static ParticleSun* createWithTotalParticles(int numberOfParticles);
|
2021-12-25 10:04:45 +08:00
|
|
|
|
2022-03-18 21:46:07 +08:00
|
|
|
/**
|
|
|
|
* @js ctor
|
|
|
|
*/
|
|
|
|
ParticleSun() {}
|
2013-09-13 13:52:42 +08:00
|
|
|
/**
|
|
|
|
* @js NA
|
|
|
|
* @lua NA
|
|
|
|
*/
|
2021-12-25 10:04:45 +08:00
|
|
|
virtual ~ParticleSun() {}
|
2014-03-21 13:44:29 +08:00
|
|
|
|
2021-12-25 10:04:45 +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
|
|
|
|
2015-03-21 18:02:56 +08:00
|
|
|
/** @class ParticleGalaxy
|
|
|
|
* @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:
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Create a galaxy particle system.
|
|
|
|
*
|
|
|
|
* @return An autoreleased ParticleGalaxy object.
|
|
|
|
*/
|
2013-11-16 05:14:12 +08:00
|
|
|
static ParticleGalaxy* create();
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Create a galaxy particle system withe a fixed number of particles.
|
|
|
|
*
|
|
|
|
* @param numberOfParticles A given number of particles.
|
|
|
|
* @return An autoreleased ParticleGalaxy object.
|
2015-03-23 20:27:13 +08:00
|
|
|
* @js NA
|
2015-03-21 18:02:56 +08:00
|
|
|
*/
|
2013-11-16 05:14:12 +08:00
|
|
|
static ParticleGalaxy* createWithTotalParticles(int numberOfParticles);
|
2021-12-25 10:04:45 +08:00
|
|
|
|
2022-03-18 21:46:07 +08:00
|
|
|
/**
|
|
|
|
* @js ctor
|
|
|
|
*/
|
|
|
|
ParticleGalaxy() {}
|
2013-09-13 13:52:42 +08:00
|
|
|
/**
|
|
|
|
* @js NA
|
|
|
|
* @lua NA
|
|
|
|
*/
|
2021-12-25 10:04:45 +08:00
|
|
|
virtual ~ParticleGalaxy() {}
|
2014-03-21 13:44:29 +08:00
|
|
|
|
2021-12-25 10:04:45 +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
|
|
|
|
2015-03-21 18:02:56 +08:00
|
|
|
/** @class ParticleFlower
|
|
|
|
* @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:
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Create a flower particle system.
|
|
|
|
*
|
|
|
|
* @return An autoreleased ParticleFlower object.
|
|
|
|
*/
|
2013-11-16 05:14:12 +08:00
|
|
|
static ParticleFlower* create();
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Create a flower particle system withe a fixed number of particles.
|
|
|
|
*
|
|
|
|
* @param numberOfParticles A given number of particles.
|
|
|
|
* @return An autoreleased ParticleFlower object.
|
2015-03-23 20:27:13 +08:00
|
|
|
* @js NA
|
2015-03-21 18:02:56 +08:00
|
|
|
*/
|
2013-11-16 05:14:12 +08:00
|
|
|
static ParticleFlower* createWithTotalParticles(int numberOfParticles);
|
2021-12-25 10:04:45 +08:00
|
|
|
|
2022-03-18 21:46:07 +08:00
|
|
|
/**
|
|
|
|
* @js ctor
|
|
|
|
*/
|
|
|
|
ParticleFlower() {}
|
2013-09-13 13:52:42 +08:00
|
|
|
/**
|
|
|
|
* @js NA
|
|
|
|
* @lua NA
|
|
|
|
*/
|
2021-12-25 10:04:45 +08:00
|
|
|
virtual ~ParticleFlower() {}
|
2014-03-21 13:44:29 +08:00
|
|
|
|
2021-12-25 10:04:45 +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
|
|
|
|
2015-03-21 18:02:56 +08:00
|
|
|
/** @class ParticleMeteor
|
|
|
|
* @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:
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Create a meteor particle system.
|
|
|
|
*
|
|
|
|
* @return An autoreleased ParticleMeteor object.
|
|
|
|
*/
|
2021-12-25 10:04:45 +08:00
|
|
|
static ParticleMeteor* create();
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Create a meteor particle system withe a fixed number of particles.
|
|
|
|
*
|
|
|
|
* @param numberOfParticles A given number of particles.
|
|
|
|
* @return An autoreleased ParticleMeteor object.
|
2015-03-23 20:27:13 +08:00
|
|
|
* @js NA
|
2015-03-21 18:02:56 +08:00
|
|
|
*/
|
2013-11-16 05:14:12 +08:00
|
|
|
static ParticleMeteor* createWithTotalParticles(int numberOfParticles);
|
2021-12-25 10:04:45 +08:00
|
|
|
|
2022-03-18 21:46:07 +08:00
|
|
|
/**
|
|
|
|
* @js ctor
|
|
|
|
*/
|
|
|
|
ParticleMeteor() {}
|
2013-09-13 13:52:42 +08:00
|
|
|
/**
|
|
|
|
* @js NA
|
|
|
|
* @lua NA
|
|
|
|
*/
|
2021-12-25 10:04:45 +08:00
|
|
|
virtual ~ParticleMeteor() {}
|
2014-03-21 13:44:29 +08:00
|
|
|
|
2021-12-25 10:04:45 +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
|
|
|
|
2015-03-21 18:02:56 +08:00
|
|
|
/** @class ParticleSpiral
|
|
|
|
* @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:
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Create a spiral particle system.
|
|
|
|
*
|
|
|
|
* @return An autoreleased ParticleSpiral object.
|
|
|
|
*/
|
2013-11-16 05:14:12 +08:00
|
|
|
static ParticleSpiral* create();
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Create a spiral particle system withe a fixed number of particles.
|
|
|
|
*
|
|
|
|
* @param numberOfParticles A given number of particles.
|
|
|
|
* @return An autoreleased ParticleSpiral object.
|
2015-03-23 20:27:13 +08:00
|
|
|
* @js NA
|
2015-03-21 18:02:56 +08:00
|
|
|
*/
|
2013-11-16 05:14:12 +08:00
|
|
|
static ParticleSpiral* createWithTotalParticles(int numberOfParticles);
|
2021-12-25 10:04:45 +08:00
|
|
|
|
2022-03-18 21:46:07 +08:00
|
|
|
/**
|
|
|
|
* @js ctor
|
|
|
|
*/
|
|
|
|
ParticleSpiral() {}
|
2013-09-13 13:52:42 +08:00
|
|
|
/**
|
|
|
|
* @js NA
|
|
|
|
* @lua NA
|
|
|
|
*/
|
2021-12-25 10:04:45 +08:00
|
|
|
virtual ~ParticleSpiral() {}
|
2014-03-21 13:44:29 +08:00
|
|
|
|
2021-12-25 10:04:45 +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
|
|
|
|
2015-03-21 18:02:56 +08:00
|
|
|
/** @class ParticleExplosion
|
|
|
|
* @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:
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Create a explosion particle system.
|
|
|
|
*
|
|
|
|
* @return An autoreleased ParticleExplosion object.
|
|
|
|
*/
|
2013-11-16 05:14:12 +08:00
|
|
|
static ParticleExplosion* create();
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Create a explosion particle system withe a fixed number of particles.
|
|
|
|
*
|
|
|
|
* @param numberOfParticles A given number of particles.
|
|
|
|
* @return An autoreleased ParticleExplosion object.
|
2015-03-23 20:27:13 +08:00
|
|
|
* @js NA
|
2015-03-21 18:02:56 +08:00
|
|
|
*/
|
2013-11-16 05:14:12 +08:00
|
|
|
static ParticleExplosion* createWithTotalParticles(int numberOfParticles);
|
2021-12-25 10:04:45 +08:00
|
|
|
|
2022-03-18 21:46:07 +08:00
|
|
|
/**
|
|
|
|
* @js ctor
|
|
|
|
*/
|
|
|
|
ParticleExplosion() {}
|
2013-09-13 13:52:42 +08:00
|
|
|
/**
|
|
|
|
* @js NA
|
|
|
|
* @lua NA
|
|
|
|
*/
|
2021-12-25 10:04:45 +08:00
|
|
|
virtual ~ParticleExplosion() {}
|
2014-03-21 13:44:29 +08:00
|
|
|
|
2021-12-25 10:04:45 +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
|
|
|
|
2015-03-21 18:02:56 +08:00
|
|
|
/** @class ParticleSmoke
|
|
|
|
* @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:
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Create a smoke particle system.
|
|
|
|
*
|
|
|
|
* @return An autoreleased ParticleSmoke object.
|
|
|
|
*/
|
2013-11-16 05:14:12 +08:00
|
|
|
static ParticleSmoke* create();
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Create a smoke particle system withe a fixed number of particles.
|
|
|
|
*
|
|
|
|
* @param numberOfParticles A given number of particles.
|
|
|
|
* @return An autoreleased ParticleSmoke object.
|
2015-03-23 20:27:13 +08:00
|
|
|
* @js NA
|
2015-03-21 18:02:56 +08:00
|
|
|
*/
|
2013-11-16 05:14:12 +08:00
|
|
|
static ParticleSmoke* createWithTotalParticles(int numberOfParticles);
|
2021-12-25 10:04:45 +08:00
|
|
|
|
2022-03-18 21:46:07 +08:00
|
|
|
/**
|
|
|
|
* @js ctor
|
|
|
|
*/
|
|
|
|
ParticleSmoke() {}
|
2013-09-13 13:52:42 +08:00
|
|
|
/**
|
|
|
|
* @js NA
|
|
|
|
* @lua NA
|
|
|
|
*/
|
2021-12-25 10:04:45 +08:00
|
|
|
virtual ~ParticleSmoke() {}
|
2014-03-21 13:44:29 +08:00
|
|
|
|
2021-12-25 10:04:45 +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
|
|
|
|
2015-03-21 18:02:56 +08:00
|
|
|
/** @class ParticleSnow
|
|
|
|
* @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:
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Create a snow particle system.
|
|
|
|
*
|
|
|
|
* @return An autoreleased ParticleSnow object.
|
|
|
|
*/
|
2013-11-16 05:14:12 +08:00
|
|
|
static ParticleSnow* create();
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Create a snow particle system withe a fixed number of particles.
|
|
|
|
*
|
|
|
|
* @param numberOfParticles A given number of particles.
|
|
|
|
* @return An autoreleased ParticleSnow object.
|
2015-03-23 20:27:13 +08:00
|
|
|
* @js NA
|
2015-03-21 18:02:56 +08:00
|
|
|
*/
|
2013-11-16 05:14:12 +08:00
|
|
|
static ParticleSnow* createWithTotalParticles(int numberOfParticles);
|
2021-12-25 10:04:45 +08:00
|
|
|
|
2022-03-18 21:46:07 +08:00
|
|
|
/**
|
|
|
|
* @js ctor
|
|
|
|
*/
|
|
|
|
ParticleSnow() {}
|
2013-09-13 13:52:42 +08:00
|
|
|
/**
|
|
|
|
* @js NA
|
|
|
|
* @lua NA
|
|
|
|
*/
|
2021-12-25 10:04:45 +08:00
|
|
|
virtual ~ParticleSnow() {}
|
2014-03-21 13:44:29 +08:00
|
|
|
|
2021-12-25 10:04:45 +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
|
|
|
|
2015-03-21 18:02:56 +08:00
|
|
|
/** @class ParticleRain
|
|
|
|
* @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:
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Create a rain particle system.
|
|
|
|
*
|
|
|
|
* @return An autoreleased ParticleRain object.
|
|
|
|
*/
|
2013-11-16 05:14:12 +08:00
|
|
|
static ParticleRain* create();
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Create a rain particle system withe a fixed number of particles.
|
|
|
|
*
|
|
|
|
* @param numberOfParticles A given number of particles.
|
|
|
|
* @return An autoreleased ParticleRain object.
|
2015-03-23 20:27:13 +08:00
|
|
|
* @js NA
|
2015-03-21 18:02:56 +08:00
|
|
|
*/
|
2013-11-16 05:14:12 +08:00
|
|
|
static ParticleRain* createWithTotalParticles(int numberOfParticles);
|
2021-12-25 10:04:45 +08:00
|
|
|
|
2022-03-18 21:46:07 +08:00
|
|
|
/**
|
|
|
|
* @js ctor
|
|
|
|
*/
|
|
|
|
ParticleRain() {}
|
2013-09-13 13:52:42 +08:00
|
|
|
/**
|
|
|
|
* @js NA
|
|
|
|
* @lua NA
|
|
|
|
*/
|
2021-12-25 10:04:45 +08:00
|
|
|
virtual ~ParticleRain() {}
|
2014-03-21 13:44:29 +08:00
|
|
|
|
2021-12-25 10:04:45 +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
|
|
|
|
2015-03-24 10:34:41 +08:00
|
|
|
// end of _2d group
|
2012-06-20 18:09:11 +08:00
|
|
|
/// @}
|
|
|
|
|
2022-07-11 17:50:21 +08:00
|
|
|
NS_AX_END
|
2011-03-19 10:07:16 +08:00
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
#endif //__CCPARTICLE_EXAMPLE_H__
|