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

Lets an object fade in or out. More...

Public Member Functions

 FadeAnimation (float inRatio, float outRatio)
 Constructor. More...
template<class Animated >
void operator() (Animated &animated, float progress) const
 Animates the object. More...

Detailed Description

Lets an object fade in or out.

Changes the alpha value of animated objects at the beginning and/or end of the animation.

Constructor & Destructor Documentation

thor::FadeAnimation::FadeAnimation ( float  inRatio,
float  outRatio 


inRatioThe part of time during which the object is faded in. Must be in the interval [0, 1].
outRatioThe part of time during which the object is faded out. Must be in the interval [0, 1-inRatio].

Example: Let's say you want an object to fade in during the first quarter of its animation, and to fade out during the second half of its animation. Therefore, inRatio = 0.25 and outRatio = 0.5.

Member Function Documentation

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

Animates the object.

animatedObject to fade in and/or out.
progressValue in [0,1] determining the progress of the animation.
Template Parameters
AnimatedType of animated object. The function thor::setAlpha() is invoked for it.

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