Handles Particle objects and Particle Effect functions.
More...
#include <PS_ParticleEffect.h>
|
| PS_ParticleEffect (C_Texture *texture, C_Vec2 emitter, bool emit, float moveSpeed, float scale) |
| Constructs the ParticleEffect Object. More...
|
|
| PS_ParticleEffect (C_Texture *texture, C_Vec2 emitter, bool emit, float moveSpeed, float scale, float timerLength) |
| Constructs the ParticleEffect Object. More...
|
|
| PS_ParticleEffect (C_Texture *texture, C_Vec2 emitter, bool emit, float moveSpeed, float scale, SDL_Colour minTint, SDL_Colour maxTint) |
| Constructs the ParticleEffect Object. More...
|
|
| PS_ParticleEffect (C_Texture *texture, C_Vec2 emitter, bool emit, float moveSpeed, float scale, float timerLength, SDL_Colour minTint, SDL_Colour maxTint) |
| Constructs the ParticleEffect Object. More...
|
|
| ~PS_ParticleEffect () |
| Destructs the ParticleEffect Object deleting the Particle Object from memory. More...
|
|
void | update (float dt) |
| A function that updates the ParticleEffect. More...
|
|
void | draw (SDL_Renderer *renderer) |
| Draws the ParticleEffect. More...
|
|
void | setEmitter (C_Vec2 emitter) |
| Set the position of the emitter. More...
|
|
void | setEmitting (bool emit) |
| Set the value of the emit boolean. More...
|
|
void | setMoveSpeed (float moveSpeed) |
| Set the value of the movement speed. More...
|
|
void | setParticleScale (float scale) |
| Set the scale of the particles. More...
|
|
C_Timer * | getLifeSpan () |
| Get the timer for the lifespan of the effect. More...
|
|
void | setDead (bool dead) |
| Set the value of dead. More...
|
|
bool | getDead () |
| Get the value of dead. More...
|
|
Handles Particle objects and Particle Effect functions.
- Author
- Jamie Slowgrove
PS_ParticleEffect::PS_ParticleEffect |
( |
C_Texture * |
texture, |
|
|
C_Vec2 |
emitter, |
|
|
bool |
emit, |
|
|
float |
moveSpeed, |
|
|
float |
scale |
|
) |
| |
Constructs the ParticleEffect Object.
- Parameters
-
texture | A pointer to the particle texture. |
emitter | The position that the particle effect emits from. |
emit | The new value of the emit boolean. |
moveSpeed | The speed of the particle effect movement. |
scale | The scale of the particles. |
PS_ParticleEffect::PS_ParticleEffect |
( |
C_Texture * |
texture, |
|
|
C_Vec2 |
emitter, |
|
|
bool |
emit, |
|
|
float |
moveSpeed, |
|
|
float |
scale, |
|
|
float |
timerLength |
|
) |
| |
Constructs the ParticleEffect Object.
- Parameters
-
texture | A pointer to the particle texture. |
emitter | The position that the particle effect emits from. |
emit | The new value of the emit boolean. |
moveSpeed | The speed of the particle effect movement. |
scale | The scale of the particles. |
timerLength | The length of the lifespan timer for the particle effect. |
PS_ParticleEffect::PS_ParticleEffect |
( |
C_Texture * |
texture, |
|
|
C_Vec2 |
emitter, |
|
|
bool |
emit, |
|
|
float |
moveSpeed, |
|
|
float |
scale, |
|
|
SDL_Colour |
minTint, |
|
|
SDL_Colour |
maxTint |
|
) |
| |
Constructs the ParticleEffect Object.
- Parameters
-
texture | A pointer to the particle texture. |
emitter | The position that the particle effect emits from. |
emit | The new value of the emit boolean. |
moveSpeed | The speed of the particle effect movement. |
scale | The scale of the particles. |
minTint | The minimum tint for the particles. |
maxTint | The maximum tint for the particles. |
PS_ParticleEffect::PS_ParticleEffect |
( |
C_Texture * |
texture, |
|
|
C_Vec2 |
emitter, |
|
|
bool |
emit, |
|
|
float |
moveSpeed, |
|
|
float |
scale, |
|
|
float |
timerLength, |
|
|
SDL_Colour |
minTint, |
|
|
SDL_Colour |
maxTint |
|
) |
| |
Constructs the ParticleEffect Object.
- Parameters
-
texture | A pointer to the particle texture. |
emitter | The position that the particle effect emits from. |
emit | The new value of the emit boolean. |
moveSpeed | The speed of the particle effect movement. |
scale | The scale of the particles. |
timerLength | The length of the lifespan timer for the particle effect. |
minTint | The minimum tint for the particles. |
maxTint | The maximum tint for the particles. |
PS_ParticleEffect::~PS_ParticleEffect |
( |
| ) |
|
Destructs the ParticleEffect Object deleting the Particle Object from memory.
void PS_ParticleEffect::draw |
( |
SDL_Renderer * |
renderer | ) |
|
Draws the ParticleEffect.
- Parameters
-
renderer | A pointer to the renderer. |
bool PS_ParticleEffect::getDead |
( |
| ) |
|
Get the value of dead.
- Returns
- If the particle effect is dead.
C_Timer * PS_ParticleEffect::getLifeSpan |
( |
| ) |
|
Get the timer for the lifespan of the effect.
- Returns
- A pointer to the timer of the particle effect.
void PS_ParticleEffect::makeNewParticles |
( |
| ) |
|
|
private |
Creates the new Particle objects.
void PS_ParticleEffect::setDead |
( |
bool |
dead | ) |
|
Set the value of dead.
- Parameters
-
void PS_ParticleEffect::setEmitter |
( |
C_Vec2 |
emitter | ) |
|
Set the position of the emitter.
- Parameters
-
emitter | The new position of the emitter. |
void PS_ParticleEffect::setEmitting |
( |
bool |
emit | ) |
|
Set the value of the emit boolean.
- Parameters
-
emit | The new value of the emit boolean. |
void PS_ParticleEffect::setMoveSpeed |
( |
float |
moveSpeed | ) |
|
Set the value of the movement speed.
- Parameters
-
moveSpeed | The new value of the movement speed. |
void PS_ParticleEffect::setParticleScale |
( |
float |
scale | ) |
|
Set the scale of the particles.
- Parameters
-
scale | The scale of the particle. |
void PS_ParticleEffect::update |
( |
float |
dt | ) |
|
A function that updates the ParticleEffect.
- Parameters
-
bool PS_ParticleEffect::dead |
|
private |
A boolean for if the particle effect should be deleted.
bool PS_ParticleEffect::emit |
|
private |
A boolean for if the ParticleEffect should emit.
C_Vec2 PS_ParticleEffect::emitter |
|
private |
The position of the Particle emitter.
C_Timer* PS_ParticleEffect::lifeSpan |
|
private |
A timer for the lifespan of the particle effect.
SDL_Colour PS_ParticleEffect::maxTint |
|
private |
SDL_Colour PS_ParticleEffect::minTint |
|
private |
float PS_ParticleEffect::moveSpeed |
|
private |
The move speed of the particles.
A vector of Particle objects.
float PS_ParticleEffect::scale |
|
private |
The scale of the particles.
A pointer to the Texture of the particles.
bool PS_ParticleEffect::tint |
|
private |
A boolean for if the texture will be tinted.
The documentation for this class was generated from the following files: