CUGL 3.0
Cornell University Game Library
|
#include <CUAction.h>
Public Member Functions | |
Action () | |
~Action () | |
virtual void | start (float t) |
virtual void | stop (float t) |
virtual void | set (float t) |
This is a base class for definining animation actions.
For the most part,the type ActionFunction
is sufficient for representing actions. However, for users that need the action to hold intermediate state, it may be easier to represent the action as an object. That is the purpose of this class.
To create an animation using this class, subclass it and implement the three methods start
, stop
, and set
. These correspond to the three ActionState
values that an action can be in.
All actions occur during a normalized time [0,1]. However, for the purposes of easing, these methods should be able to support values outside of that range.
|
inline |
Creates an uninitialized action.
NEVER USE A CONSTRUCTOR WITH NEW. If you want to allocate an object on the heap, use one of the static constructors instead.
|
inline |
Deletes this action, disposing all resources
|
inlinevirtual |
Sets the time of this action to t.
All actions occur during a normalized time [0,1]. However, for the purposes of easing, this method should be able to support values outside of that range.
t | The current time of this action |
|
inlinevirtual |
Prepares a target for action
This method should initialize any state necessary for the animation action. The value t represents the (normalized) start time of the action, which is typically 0.
t | The start time |
|
inlinevirtual |
Cleans up a target after an action
This method clearn any state that was used in the animation action. The value t represents the (normalized) completion time of the action, which is typically 1.
t | The completion time |