29 #ifndef THOR_FADEANIMATION_HPP
30 #define THOR_FADEANIMATION_HPP
60 template <
class Animated>
61 void operator() (Animated& animated,
float progress)
const;
76 template <
class Animated>
79 if (progress < mInRatio)
80 setAlpha(target, static_cast<sf::Uint8>(256 * progress / mInRatio));
81 else if (progress > 1.f - mOutRatio)
82 setAlpha(target, static_cast<sf::Uint8>(256 * (1.f-progress) / mOutRatio));
87 #endif // THOR_FADEANIMATION_HPP
void setAlpha(T &object, sf::Uint8 alpha)
Sets the alpha color value of a graphical object.
Definition: Animator.hpp:42
Configuration header of the library.
Lets an object fade in or out.
Definition: FadeAnimation.hpp:44
void operator()(Animated &animated, float progress) const
Animates the object.
Definition: FadeAnimation.hpp:77