123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456 |
- /****************************************************************************
- Copyright (c) 2008-2010 Ricardo Quesada
- Copyright (c) 2010-2012 cocos2d-x.org
- Copyright (c) 2011 Zynga Inc.
- Copyright (c) 2013-2016 Chukong Technologies Inc.
- Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
- 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__
- #include "2d/CCParticleSystemQuad.h"
- NS_CC_BEGIN
- /**
- * @addtogroup _2d
- * @{
- */
- /** @class ParticleFire
- * @brief A fire particle system.
- */
- class CC_DLL ParticleFire : public ParticleSystemQuad
- {
- public:
- /** Create a fire particle system.
- *
- * @return An autoreleased ParticleFire object.
- */
- static ParticleFire* create();
- /** Create a fire particle system withe a fixed number of particles.
- *
- * @param numberOfParticles A given number of particles.
- * @return An autoreleased ParticleFire object.
- * @js NA
- */
- static ParticleFire* createWithTotalParticles(int numberOfParticles);
-
- CC_CONSTRUCTOR_ACCESS:
- /**
- * @js ctor
- */
- ParticleFire(){}
- /**
- * @js NA
- * @lua NA
- */
- virtual ~ParticleFire(){}
- bool init() override { return initWithTotalParticles(250); }
- virtual bool initWithTotalParticles(int numberOfParticles) override;
- private:
- CC_DISALLOW_COPY_AND_ASSIGN(ParticleFire);
- };
- /** @class ParticleFireworks
- * @brief A fireworks particle system.
- */
- class CC_DLL ParticleFireworks : public ParticleSystemQuad
- {
- public:
- /** Create a fireworks particle system.
- *
- * @return An autoreleased ParticleFireworks object.
- */
- static ParticleFireworks* create();
- /** Create a fireworks particle system withe a fixed number of particles.
- *
- * @param numberOfParticles A given number of particles.
- * @return An autoreleased ParticleFireworks object.
- * @js NA
- */
- static ParticleFireworks* createWithTotalParticles(int numberOfParticles);
-
- CC_CONSTRUCTOR_ACCESS:
- /**
- * @js ctor
- */
- ParticleFireworks(){}
- /**
- * @js NA
- * @lua NA
- */
- virtual ~ParticleFireworks(){}
- bool init(){ return initWithTotalParticles(1500); }
- virtual bool initWithTotalParticles(int numberOfParticles);
- private:
- CC_DISALLOW_COPY_AND_ASSIGN(ParticleFireworks);
- };
- /** @class ParticleSun
- * @brief A sun particle system.
- */
- class CC_DLL ParticleSun : public ParticleSystemQuad
- {
- public:
- /** Create a sun particle system.
- *
- * @return An autoreleased ParticleSun object.
- */
- static ParticleSun* create();
- /** Create a sun particle system withe a fixed number of particles.
- *
- * @param numberOfParticles A given number of particles.
- * @return An autoreleased ParticleSun object.
- * @js NA
- */
- static ParticleSun* createWithTotalParticles(int numberOfParticles);
-
- CC_CONSTRUCTOR_ACCESS:
- /**
- * @js ctor
- */
- ParticleSun(){}
- /**
- * @js NA
- * @lua NA
- */
- virtual ~ParticleSun(){}
- bool init(){ return initWithTotalParticles(350); }
- virtual bool initWithTotalParticles(int numberOfParticles);
- private:
- CC_DISALLOW_COPY_AND_ASSIGN(ParticleSun);
- };
- /** @class ParticleGalaxy
- * @brief A galaxy particle system.
- */
- class CC_DLL ParticleGalaxy : public ParticleSystemQuad
- {
- public:
- /** Create a galaxy particle system.
- *
- * @return An autoreleased ParticleGalaxy object.
- */
- static ParticleGalaxy* create();
- /** Create a galaxy particle system withe a fixed number of particles.
- *
- * @param numberOfParticles A given number of particles.
- * @return An autoreleased ParticleGalaxy object.
- * @js NA
- */
- static ParticleGalaxy* createWithTotalParticles(int numberOfParticles);
-
- CC_CONSTRUCTOR_ACCESS:
- /**
- * @js ctor
- */
- ParticleGalaxy(){}
- /**
- * @js NA
- * @lua NA
- */
- virtual ~ParticleGalaxy(){}
- bool init(){ return initWithTotalParticles(200); }
- virtual bool initWithTotalParticles(int numberOfParticles);
- private:
- CC_DISALLOW_COPY_AND_ASSIGN(ParticleGalaxy);
- };
- /** @class ParticleFlower
- * @brief A flower particle system.
- */
- class CC_DLL ParticleFlower : public ParticleSystemQuad
- {
- public:
- /** Create a flower particle system.
- *
- * @return An autoreleased ParticleFlower object.
- */
- static ParticleFlower* create();
- /** Create a flower particle system withe a fixed number of particles.
- *
- * @param numberOfParticles A given number of particles.
- * @return An autoreleased ParticleFlower object.
- * @js NA
- */
- static ParticleFlower* createWithTotalParticles(int numberOfParticles);
-
- CC_CONSTRUCTOR_ACCESS:
- /**
- * @js ctor
- */
- ParticleFlower(){}
- /**
- * @js NA
- * @lua NA
- */
- virtual ~ParticleFlower(){}
- bool init(){ return initWithTotalParticles(250); }
- virtual bool initWithTotalParticles(int numberOfParticles);
- private:
- CC_DISALLOW_COPY_AND_ASSIGN(ParticleFlower);
- };
- /** @class ParticleMeteor
- * @brief A meteor particle system.
- */
- class CC_DLL ParticleMeteor : public ParticleSystemQuad
- {
- public:
- /** Create a meteor particle system.
- *
- * @return An autoreleased ParticleMeteor object.
- */
- static ParticleMeteor * create();
- /** Create a meteor particle system withe a fixed number of particles.
- *
- * @param numberOfParticles A given number of particles.
- * @return An autoreleased ParticleMeteor object.
- * @js NA
- */
- static ParticleMeteor* createWithTotalParticles(int numberOfParticles);
-
- CC_CONSTRUCTOR_ACCESS:
- /**
- * @js ctor
- */
- ParticleMeteor(){}
- /**
- * @js NA
- * @lua NA
- */
- virtual ~ParticleMeteor(){}
- bool init(){ return initWithTotalParticles(150); }
- virtual bool initWithTotalParticles(int numberOfParticles);
- private:
- CC_DISALLOW_COPY_AND_ASSIGN(ParticleMeteor);
- };
- /** @class ParticleSpiral
- * @brief An spiral particle system.
- */
- class CC_DLL ParticleSpiral : public ParticleSystemQuad
- {
- public:
- /** Create a spiral particle system.
- *
- * @return An autoreleased ParticleSpiral object.
- */
- static ParticleSpiral* create();
- /** Create a spiral particle system withe a fixed number of particles.
- *
- * @param numberOfParticles A given number of particles.
- * @return An autoreleased ParticleSpiral object.
- * @js NA
- */
- static ParticleSpiral* createWithTotalParticles(int numberOfParticles);
-
- CC_CONSTRUCTOR_ACCESS:
- /**
- * @js ctor
- */
- ParticleSpiral(){}
- /**
- * @js NA
- * @lua NA
- */
- virtual ~ParticleSpiral(){}
- bool init(){ return initWithTotalParticles(500); }
- virtual bool initWithTotalParticles(int numberOfParticles);
- private:
- CC_DISALLOW_COPY_AND_ASSIGN(ParticleSpiral);
- };
- /** @class ParticleExplosion
- * @brief An explosion particle system.
- */
- class CC_DLL ParticleExplosion : public ParticleSystemQuad
- {
- public:
- /** Create a explosion particle system.
- *
- * @return An autoreleased ParticleExplosion object.
- */
- static ParticleExplosion* create();
- /** Create a explosion particle system withe a fixed number of particles.
- *
- * @param numberOfParticles A given number of particles.
- * @return An autoreleased ParticleExplosion object.
- * @js NA
- */
- static ParticleExplosion* createWithTotalParticles(int numberOfParticles);
-
- CC_CONSTRUCTOR_ACCESS:
- /**
- * @js ctor
- */
- ParticleExplosion(){}
- /**
- * @js NA
- * @lua NA
- */
- virtual ~ParticleExplosion(){}
- bool init(){ return initWithTotalParticles(700); }
- virtual bool initWithTotalParticles(int numberOfParticles);
- private:
- CC_DISALLOW_COPY_AND_ASSIGN(ParticleExplosion);
- };
- /** @class ParticleSmoke
- * @brief An smoke particle system.
- */
- class CC_DLL ParticleSmoke : public ParticleSystemQuad
- {
- public:
- /** Create a smoke particle system.
- *
- * @return An autoreleased ParticleSmoke object.
- */
- static ParticleSmoke* create();
- /** Create a smoke particle system withe a fixed number of particles.
- *
- * @param numberOfParticles A given number of particles.
- * @return An autoreleased ParticleSmoke object.
- * @js NA
- */
- static ParticleSmoke* createWithTotalParticles(int numberOfParticles);
-
- CC_CONSTRUCTOR_ACCESS:
- /**
- * @js ctor
- */
- ParticleSmoke(){}
- /**
- * @js NA
- * @lua NA
- */
- virtual ~ParticleSmoke(){}
- bool init(){ return initWithTotalParticles(200); }
- virtual bool initWithTotalParticles(int numberOfParticles);
- private:
- CC_DISALLOW_COPY_AND_ASSIGN(ParticleSmoke);
- };
- /** @class ParticleSnow
- * @brief An snow particle system.
- */
- class CC_DLL ParticleSnow : public ParticleSystemQuad
- {
- public:
- /** Create a snow particle system.
- *
- * @return An autoreleased ParticleSnow object.
- */
- static ParticleSnow* create();
- /** Create a snow particle system withe a fixed number of particles.
- *
- * @param numberOfParticles A given number of particles.
- * @return An autoreleased ParticleSnow object.
- * @js NA
- */
- static ParticleSnow* createWithTotalParticles(int numberOfParticles);
-
- CC_CONSTRUCTOR_ACCESS:
- /**
- * @js ctor
- */
- ParticleSnow(){}
- /**
- * @js NA
- * @lua NA
- */
- virtual ~ParticleSnow(){}
- bool init(){ return initWithTotalParticles(700); }
- virtual bool initWithTotalParticles(int numberOfParticles);
- private:
- CC_DISALLOW_COPY_AND_ASSIGN(ParticleSnow);
- };
- /** @class ParticleRain
- * @brief A rain particle system.
- */
- class CC_DLL ParticleRain : public ParticleSystemQuad
- {
- public:
- /** Create a rain particle system.
- *
- * @return An autoreleased ParticleRain object.
- */
- static ParticleRain* create();
- /** Create a rain particle system withe a fixed number of particles.
- *
- * @param numberOfParticles A given number of particles.
- * @return An autoreleased ParticleRain object.
- * @js NA
- */
- static ParticleRain* createWithTotalParticles(int numberOfParticles);
-
- CC_CONSTRUCTOR_ACCESS:
- /**
- * @js ctor
- */
- ParticleRain(){}
- /**
- * @js NA
- * @lua NA
- */
- virtual ~ParticleRain(){}
- bool init(){ return initWithTotalParticles(1000); }
- virtual bool initWithTotalParticles(int numberOfParticles);
- private:
- CC_DISALLOW_COPY_AND_ASSIGN(ParticleRain);
- };
- // end of _2d group
- /// @}
- NS_CC_END
- #endif //__CCPARTICLE_EXAMPLE_H__
|