Applies a color gradient to particles. More...
Public Types | |
typedef std::tr1::shared_ptr < ColorAffector > | Ptr |
Shared pointer type referring to ColorAffector objects. | |
Static Public Member Functions | |
static Ptr | Create (const ColorGradient &gradient) |
Creates an affector that colorizes particles according to a given gradient. | |
Public Member Functions | |
ColorAffector (const ColorGradient &gradient) | |
Constructor. | |
virtual void | Affect (Particle &particle, sf::Time dt) |
Affects particles. | |
void | SetGradient (const ColorGradient &gradient) |
Sets the color gradient used to colorize the particles. | |
const ColorGradient & | GetGradient () const |
Returns the color gradient used to colorize the particles. |
Applies a color gradient to particles.
Affector class that changes the color of a particle smoothly from one to another.
thor::ColorAffector::ColorAffector | ( | const ColorGradient & | gradient | ) | [explicit] |
Constructor.
Creates a color gradient over the whole lifetime of the particles.
gradient | The color gradient affecting the particles. Can also be a single sf::Color. |
virtual void thor::ColorAffector::Affect | ( | Particle & | particle, |
sf::Time | dt | ||
) | [virtual] |
Affects particles.
particle | The particle currently being affected. |
dt | Time interval during which particles are affected. |
Implements thor::Affector.
static Ptr thor::ColorAffector::Create | ( | const ColorGradient & | gradient | ) | [static] |
Creates an affector that colorizes particles according to a given gradient.
Creates a color gradient over the whole lifetime of the particles.
gradient | The color gradient affecting the particles. Can also be a single sf::Color. |