Classes | Functions
Animations

Classes able to animate graphical objects in different ways. More...

Classes

class  thor::Animator< Animated, Id >
 Class that stores the progress of an object's animation. More...
class  thor::ColorAnimation
 Changes an object's color smoothly over time. More...
class  thor::FadeAnimation
 Lets an object fade in or out. More...
class  thor::FrameAnimation
 Changes a sprite's subrect over time. More...
class  thor::RefAnimation< Animation >
 Class to reference another animation. More...

Functions

template<typename Animation >
RefAnimation< Animation > thor::refAnimation (Animation &referenced)
 Creates an animation that references another one.

Detailed Description

Classes able to animate graphical objects in different ways.


Function Documentation

template<typename Animation >
RefAnimation< Animation > refAnimation ( Animation &  referenced) [related]

Creates an animation that references another one.

Parameters:
referencedAnimation to reference. Must remain valid during usage.

Creates an animation object that has no functionality on its own, but references another existing animation. By using it, you can avoid copies and change the original animation object, even after it has been added to a thor::Animator. On the other side, you must make sure the original animation stays alive while being referenced.

Example:

  // Create animation
  thor::FrameAnimation anim;

  // Insert reference into animator
  thor::Animator<...> animator;
  animator.addAnimation(..., thor::refAnimation(anim), ...);

  // Later changes will affect animation inside animator
  anim.addFrame(...);