Bromeon
Public Types | Static Public Member Functions | Public Member Functions
thor::FadeOutAffector Class Reference

Fades particles out over time. More...

Inheritance diagram for thor::FadeOutAffector:
Inheritance graph

List of all members.

Public Types

typedef std::tr1::shared_ptr
< FadeOutAffector
Ptr
 Shared pointer type referring to FadeOutAffector objects.

Static Public Member Functions

static Ptr Create (float timeRatio=1.f)
 Creates an affector that decreases the alpha value towards the end of the particle lifetime.

Public Member Functions

 FadeOutAffector (float timeRatio=1.f)
 Constructor.
virtual void Affect (Particle &particle, sf::Time dt)
 Affects particles.
void SetTimeRatio (float timeRatio)
 Sets the time ratio (how long the fade-out time is compared to the particle lifetime).
float GetTimeRatio () const
 Returns the time ratio (how long the fade-out time is compared to the particle lifetime).

Detailed Description

Fades particles out over time.

Affector class that constantly decreases the alpha color value of a particle.


Constructor & Destructor Documentation

thor::FadeOutAffector::FadeOutAffector ( float  timeRatio = 1.f) [explicit]

Constructor.

Parameters:
timeRatioHow long the fade-out time is in comparison to the total particle lifetime. For example, 1.f means over the whole lifetime, and 0.25f means to fade out the particle only in the last quarter.

Member Function Documentation

virtual void thor::FadeOutAffector::Affect ( Particle particle,
sf::Time  dt 
) [virtual]

Affects particles.

Parameters:
particleThe particle currently being affected.
dtTime interval during which particles are affected.

Implements thor::Affector.

static Ptr thor::FadeOutAffector::Create ( float  timeRatio = 1.f) [static]

Creates an affector that decreases the alpha value towards the end of the particle lifetime.

Parameters:
timeRatioHow long the fade-out time is in comparison to the total particle lifetime. For example, 1.f means over the whole lifetime, and 0.25f means to fade out the particle only in the last quarter.


The documentation for this class was generated from the following file: