TextParticleSystem Class Reference
A simple particle system that draws each partical as a string of text.
More...
#include <Game/TextParticleSystem.h>
List of all members.
Public Types |
typedef void(* | fnUpdateFunc )(TextParticle &p, float dt) |
| Defines the prototype of the particle update function that will be called for each active particle in the system.
|
Public Member Functions |
| TextParticleSystem () |
| Default constructor.
|
void | Update (float dt) |
| Updates the active particles.
|
void | Emit (const std::string &str, const Point2f &pos, const Color4f &c) |
| Adds a new text particle to the system.
|
void | SetAttributes (FontRef f, float maxAge) |
| Sets the attributes of the particle system.
|
FontRef | GetFont () const |
| Returns the font used to draw the particle system.
|
void | Draw () const |
| Draws all of the active particles.
|
void | Clear () |
| Clears all of the active particles.
|
void | SetUpdateFunc (fnUpdateFunc f) |
| Sets the update function for the particle system.
|
Static Public Member Functions |
static void | DefaultUpdateFunc (TextParticle &p, float dt) |
| The default update function that linearly decrease the transparancy of the particles.
|
Detailed Description
A simple particle system that draws each partical as a string of text.
Member Typedef Documentation
Defines the prototype of the particle update function that will be called for each active particle in the system.
fnUpdateFunc
- Parameters:
-
[in] | p | the particle to update. |
[in] | dt | the frame time in seconds since the last frame. |
Member Function Documentation
void TextParticleSystem::DefaultUpdateFunc |
( |
TextParticle & |
p, |
|
|
float |
dt | |
|
) |
| | [static] |
The default update function that linearly decrease the transparancy of the particles.
- Parameters:
-
[in] | p | the particle to update. |
[in] | dt | the frame time in seconds since the last frame. |
void TextParticleSystem::Emit |
( |
const std::string & |
str, |
|
|
const Point2f & |
pos, |
|
|
const Color4f & |
c | |
|
) |
| | |
Adds a new text particle to the system.
- Parameters:
-
[in] | str | the text associated with the text particle. |
[in] | pos | the position to spawn the text particle. |
[in] | c | the color to spawn the particle. |
void TextParticleSystem::SetAttributes |
( |
FontRef |
f, |
|
|
float |
maxAge | |
|
) |
| | |
Sets the attributes of the particle system.
[in] f the font to draw the text particles.
- Parameters:
-
[in] | maxAge | the life time of each particle. |
void TextParticleSystem::SetUpdateFunc |
( |
fnUpdateFunc |
f |
) |
[inline] |
Sets the update function for the particle system.
- Parameters:
-
[in] | f | the pointer to the update function. |
void TextParticleSystem::Update |
( |
float |
dt |
) |
|
Updates the active particles.
- Parameters:
-
[in] | dt | the time in seconds since the last frame. |
The documentation for this class was generated from the following files: