.. index:: pair: class; EE::Graphics::ParticleSystem .. _doxid-class_e_e_1_1_graphics_1_1_particle_system: class EE::Graphics::ParticleSystem ================================== .. toctree:: :hidden: Overview ~~~~~~~~ Basic but powerfull :ref:`Particle ` :ref:`System `. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include class ParticleSystem { public: // typedefs typedef std::function`*, ParticleSystem*)> :target:`ParticleCallback`; // construction virtual :target:`~ParticleSystem`(); // methods void :ref:`create`( const :ref:`ParticleEffect`& Effect, const :ref:`Uint32`& NumParticles, const :ref:`Uint32`& TexId, const :ref:`Vector2f`& Pos, const :ref:`Float`& PartSize = 16.0f, const bool& AnimLoop = false, const :ref:`Uint32`& NumLoops = 1, const :ref:`ColorAf`& color = :ref:`ColorAf`(1.0f, 1.0f, 1.0f, 1.0f), const :ref:`Vector2f`& Pos2 = :ref:`Vector2f`(0, 0), const :ref:`Float`& alphaDecay = 0.01f, const :ref:`Vector2f`& speed = :ref:`Vector2f`(0.1f, 0.1f), const :ref:`Vector2f`& Acc = :ref:`Vector2f`(0.1f, 0.1f) ); void :ref:`draw`(); void :ref:`update`(const :ref:`Time`& time); void :ref:`update`(); void :ref:`end`(); void :ref:`reuse`(); void :ref:`kill`(); void :ref:`time`(const :ref:`Float`& time); :ref:`Float` :ref:`time`() const; void :ref:`setUsing`(const bool& inuse); bool :ref:`isUsing`() const; void :ref:`setPosition`(const :ref:`Float`& x, const :ref:`Float`& y); void :ref:`setPosition`(const :ref:`Vector2f`& Pos); const :ref:`Vector2f`& :ref:`getPosition`() const; void :ref:`setPosition2`(const :ref:`Float`& x, const :ref:`Float`& y); void :ref:`setPosition2`(const :ref:`Vector2f`& Pos); const :ref:`Vector2f`& :ref:`getPosition2`() const; void :ref:`setCallbackReset`(const :ref:`ParticleCallback`& pc); const :ref:`BlendMode`& :ref:`getBlendMode`() const; void :ref:`setBlendMode`(const :ref:`BlendMode`& mode); const :ref:`ColorAf`& :ref:`getColor`() const; void :ref:`setColor`(const :ref:`ColorAf`& Col); const :ref:`Float`& :ref:`getAlphaDecay`() const; void :ref:`setAlphaDecay`(const :ref:`Float`& Decay); const :ref:`Vector2f`& :ref:`getSpeed`() const; void :ref:`setSpeed`(const :ref:`Vector2f`& speed); const :ref:`Vector2f`& :ref:`getAcceleration`() const; void :ref:`setAcceleration`(const :ref:`Vector2f`& acc); }; .. _details-class_e_e_1_1_graphics_1_1_particle_system: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Basic but powerfull :ref:`Particle ` :ref:`System `. Methods ------- .. index:: pair: function; create .. _doxid-class_e_e_1_1_graphics_1_1_particle_system_1a5186e954c0d8116f9d4adee7b02f75aa: .. ref-code-block:: cpp :class: doxyrest-title-code-block void create( const :ref:`ParticleEffect`& Effect, const :ref:`Uint32`& NumParticles, const :ref:`Uint32`& TexId, const :ref:`Vector2f`& Pos, const :ref:`Float`& PartSize = 16.0f, const bool& AnimLoop = false, const :ref:`Uint32`& NumLoops = 1, const :ref:`ColorAf`& color = :ref:`ColorAf`(1.0f, 1.0f, 1.0f, 1.0f), const :ref:`Vector2f`& Pos2 = :ref:`Vector2f`(0, 0), const :ref:`Float`& alphaDecay = 0.01f, const :ref:`Vector2f`& speed = :ref:`Vector2f`(0.1f, 0.1f), const :ref:`Vector2f`& Acc = :ref:`Vector2f`(0.1f, 0.1f) ) Creates the new effect .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - Effect - Number of the effect. * - NumParticles - Number of particles * - TexId - :ref:`Texture ` Id to render the particles * - Pos - Initial position * - PartSize - Size of the particles * - AnimLoop - Loop the animation? * - NumLoops - If AnimLoop is false, set the number of times to render the effect * - color - Particles Color (used for NoFx) * - Pos2 - Extended position for some effects to define the expansion over the screen (used by fire,smoke,snow) * - alphaDecay - The Alpha Decay for the particles (used for NoFx) * - speed - The speed on x axis (used for NoFx) * - Acc - The acceleration of the particle (used for NoFx) .. index:: pair: function; draw .. _doxid-class_e_e_1_1_graphics_1_1_particle_system_1ac3a329019e1f2db2f08ce7bd14743dee: .. ref-code-block:: cpp :class: doxyrest-title-code-block void draw() Draw the particles effect .. index:: pair: function; update .. _doxid-class_e_e_1_1_graphics_1_1_particle_system_1a1e360ef3fc827e48be0507de359e64b0: .. ref-code-block:: cpp :class: doxyrest-title-code-block void update(const :ref:`Time`& time) Update the particles effect .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - time - The time transcurred between the last update. .. index:: pair: function; update .. _doxid-class_e_e_1_1_graphics_1_1_particle_system_1aa4e9fe17f2c8c6d2a4dd989111464ab8: .. ref-code-block:: cpp :class: doxyrest-title-code-block void update() Update the particles effect taking the elapsed time from Engine .. index:: pair: function; end .. _doxid-class_e_e_1_1_graphics_1_1_particle_system_1aefc2c3e24db798ad18df33aa2c1d6fb4: .. ref-code-block:: cpp :class: doxyrest-title-code-block void end() Stop using the effect but wait to end the animation .. index:: pair: function; reuse .. _doxid-class_e_e_1_1_graphics_1_1_particle_system_1a435f3c49b193356285e50d4a2dfc3618: .. ref-code-block:: cpp :class: doxyrest-title-code-block void reuse() Start using the effect and reset it .. index:: pair: function; kill .. _doxid-class_e_e_1_1_graphics_1_1_particle_system_1a06ac6d10435d33ac704368c92b96a5f8: .. ref-code-block:: cpp :class: doxyrest-title-code-block void kill() Stop immediately the effect .. index:: pair: function; time .. _doxid-class_e_e_1_1_graphics_1_1_particle_system_1a23784329c915bb3795724b183481df8b: .. ref-code-block:: cpp :class: doxyrest-title-code-block void time(const :ref:`Float`& time) Change the default time modifier. Default 0.01f .. index:: pair: function; time .. _doxid-class_e_e_1_1_graphics_1_1_particle_system_1aecebc88036171d5e8b3be6973e69ce90: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`Float` time() const Get the time modifier .. index:: pair: function; setUsing .. _doxid-class_e_e_1_1_graphics_1_1_particle_system_1afb8cfb7e511dffa68dfa4a4815c0dbe6: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setUsing(const bool& inuse) Set if the effect it's in use .. index:: pair: function; isUsing .. _doxid-class_e_e_1_1_graphics_1_1_particle_system_1aad27937d20025922d65fa5760283027a: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool isUsing() const .. rubric:: Returns: It's used or no .. index:: pair: function; setPosition .. _doxid-class_e_e_1_1_graphics_1_1_particle_system_1a609ecfc87c230fe1e21c07edb03691a8: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setPosition(const :ref:`Float`& x, const :ref:`Float`& y) Update the effect position .. index:: pair: function; setPosition .. _doxid-class_e_e_1_1_graphics_1_1_particle_system_1a0cccc993a81e227c5b14eeb93415399f: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setPosition(const :ref:`Vector2f`& Pos) Update the effect position .. index:: pair: function; getPosition .. _doxid-class_e_e_1_1_graphics_1_1_particle_system_1ad92cb5787fd5c38e3e9dcec28ed8a893: .. ref-code-block:: cpp :class: doxyrest-title-code-block const :ref:`Vector2f`& getPosition() const .. rubric:: Returns: The effect position .. index:: pair: function; setPosition2 .. _doxid-class_e_e_1_1_graphics_1_1_particle_system_1a0c91314a5c1df13696a4813cb202542d: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setPosition2(const :ref:`Float`& x, const :ref:`Float`& y) Update the effect position 2 .. index:: pair: function; setPosition2 .. _doxid-class_e_e_1_1_graphics_1_1_particle_system_1ae230de3a3ffb724c16a3096c1d08f3d2: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setPosition2(const :ref:`Vector2f`& Pos) Update the effect position 2 .. index:: pair: function; getPosition2 .. _doxid-class_e_e_1_1_graphics_1_1_particle_system_1a10b14b0e81fd14918c634a6f8a8719b3: .. ref-code-block:: cpp :class: doxyrest-title-code-block const :ref:`Vector2f`& getPosition2() const .. rubric:: Returns: The effect position 2 .. index:: pair: function; setCallbackReset .. _doxid-class_e_e_1_1_graphics_1_1_particle_system_1a560eec9d1c9ac4a8dc840c1e195744cd: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setCallbackReset(const :ref:`ParticleCallback`& pc) Set a callback function for the reset effect of the particles. The reset it's where do you create the effect for every single particle. .. index:: pair: function; getBlendMode .. _doxid-class_e_e_1_1_graphics_1_1_particle_system_1ac46c23d2b8574824b1263f4a65c068c0: .. ref-code-block:: cpp :class: doxyrest-title-code-block const :ref:`BlendMode`& getBlendMode() const .. rubric:: Returns: The effect blend mode .. index:: pair: function; setBlendMode .. _doxid-class_e_e_1_1_graphics_1_1_particle_system_1a00d85a9455cfdc86d2e71590fffcb888: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setBlendMode(const :ref:`BlendMode`& mode) Set the effect blend mode .. index:: pair: function; getColor .. _doxid-class_e_e_1_1_graphics_1_1_particle_system_1ac1e65ef44eb1bd0b47f38b8993573ec7: .. ref-code-block:: cpp :class: doxyrest-title-code-block const :ref:`ColorAf`& getColor() const .. rubric:: Returns: The color of the effect .. index:: pair: function; setColor .. _doxid-class_e_e_1_1_graphics_1_1_particle_system_1ac6171c91acc553ba83da35dc2cff6041: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setColor(const :ref:`ColorAf`& Col) Set the color of the effect .. index:: pair: function; getAlphaDecay .. _doxid-class_e_e_1_1_graphics_1_1_particle_system_1a5a9db146d26fedfbe9f6bd2f1928943e: .. ref-code-block:: cpp :class: doxyrest-title-code-block const :ref:`Float`& getAlphaDecay() const .. rubric:: Returns: The alpha decay of the effect .. index:: pair: function; setAlphaDecay .. _doxid-class_e_e_1_1_graphics_1_1_particle_system_1ae3eec45e4ee1f6ad25b6286fea367bc8: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setAlphaDecay(const :ref:`Float`& Decay) Set the alpha decay of the effect .. index:: pair: function; getSpeed .. _doxid-class_e_e_1_1_graphics_1_1_particle_system_1acc690b783b32a4d4f4bd839b339a7aee: .. ref-code-block:: cpp :class: doxyrest-title-code-block const :ref:`Vector2f`& getSpeed() const .. rubric:: Returns: The Speed of the effect .. index:: pair: function; setSpeed .. _doxid-class_e_e_1_1_graphics_1_1_particle_system_1acf23f382c75a5e3ceafa203177dce216: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setSpeed(const :ref:`Vector2f`& speed) Set the Speed of the effect .. index:: pair: function; getAcceleration .. _doxid-class_e_e_1_1_graphics_1_1_particle_system_1a5936ae4cb1def8313936f9b3d0f153b2: .. ref-code-block:: cpp :class: doxyrest-title-code-block const :ref:`Vector2f`& getAcceleration() const .. rubric:: Returns: The Acceleration of the effect .. index:: pair: function; setAcceleration .. _doxid-class_e_e_1_1_graphics_1_1_particle_system_1a9dac4f75714839be0f49385aabdeac15: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setAcceleration(const :ref:`Vector2f`& acc) Set The Acceleration of the effect