List of all members | Public Member Functions
thor::ColorAnimation Class Reference

Changes an object's color smoothly over time. More...

Public Member Functions

 ColorAnimation (const ColorGradient &gradient)
 Constructor. More...
 
template<class Animated >
void operator() (Animated &animated, float progress) const
 Animates the object. More...
 

Detailed Description

Changes an object's color smoothly over time.

This class stores a ColorGradient which is applied to animated objects.

Constructor & Destructor Documentation

thor::ColorAnimation::ColorAnimation ( const ColorGradient gradient)
explicit

Constructor.

Parameters
gradientThe color gradient affecting the objects. Can also be a single sf::Color.

Member Function Documentation

template<class Animated >
void thor::ColorAnimation::operator() ( Animated &  animated,
float  progress 
) const

Animates the object.

Parameters
animatedObject to colorize according to the color gradient.
progressValue in [0,1] determining the progress of the animation.
Template Parameters
AnimatedType of animated object. The function thor::setColor() is invoked for it.

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