Abstract base class for animations. More...
Public Types | |
typedef std::tr1::shared_ptr < Animation > | Ptr |
Shared pointer type to Animation objects. | |
Public Member Functions | |
virtual void | Apply (sf::Sprite &target, float progress) const =0 |
Applies the animation to a sprite. |
Abstract base class for animations.
This class defines the interface for concrete animations that affect sf::Sprite. Note that thor::Animation and its derivates do not store the current animation progress. They only specify how an animation runs, i.e. how it changes depending on the progress. The actual progress is computed by thor::Animator. As a result of this separation, multiple animators can refer to a single animation.
virtual void thor::Animation::Apply | ( | sf::Sprite & | target, |
float | progress | ||
) | const [pure virtual] |
Applies the animation to a sprite.
target | The sprite who is modified according to the animation. |
progress | Total animation progress, in the interval [0,1]. |
Implemented in thor::FrameAnimation.