#include <Animation.h>
Classes | |
class | Channel |
Public Member Functions | |
const char * | getId () const |
unsigned long | getDuration () const |
void | createClips (const char *url) |
AnimationClip * | createClip (const char *id, unsigned long begin, unsigned long end) |
AnimationClip * | getClip (const char *clipId=NULL) |
AnimationClip * | getClip (unsigned int index) const |
unsigned int | getClipCount () const |
void | play (const char *clipId=NULL) |
void | stop (const char *clipId=NULL) |
void | pause (const char *clipId=NULL) |
bool | targets (AnimationTarget *target) const |
Defines a generic property animation.
To run an animation you must play an AnimationClip. Every Animation has the default clip which will run from begin-end time. You can create additional clips to run only parts of an animation and control various runtime characteristics, such as repeat count, etc.
AnimationClip* gameplay::Animation::createClip | ( | const char * | id, |
unsigned long | begin, | ||
unsigned long | end | ||
) |
Creates an AnimationClip from the Animation.
id | The ID to the give the AnimationClip. |
begin | The begin time (in milliseconds) or keyframe(for keyframe animations). |
end | The end time (in milliseconds) or keyframe (for keyframe animations). |
void gameplay::Animation::createClips | ( | const char * | url | ) |
Creates an AnimationClip from the Properties object defined at the specified URL, where the URL is of the format "<file-path>.<extension>#<namespace-id>/<namespace-id>/.../<namespace-id>" (and "#<namespace-id>/<namespace-id>/.../<namespace-id>" is optional).
url | The URL pointing to the Properties object containing the clip definitions. |
AnimationClip* gameplay::Animation::getClip | ( | const char * | clipId = NULL | ) |
Finds the AnimationClip with the specified name. If NULL, gets the default clip.
clipId | The ID of the AnimationClip to get. |
AnimationClip* gameplay::Animation::getClip | ( | unsigned int | index | ) | const |
Returns the AnimationClip at the given index.
index | Index of the clip to return. |
unsigned int gameplay::Animation::getClipCount | ( | ) | const |
Returns the number of animation clips in this animation.
unsigned long gameplay::Animation::getDuration | ( | ) | const |
const char* gameplay::Animation::getId | ( | ) | const |
void gameplay::Animation::pause | ( | const char * | clipId = NULL | ) |
Pauses the AnimationClip with the specified name.
clipId | The ID of the AnimationClip to pause. If NULL, pauses the default clip. |
void gameplay::Animation::play | ( | const char * | clipId = NULL | ) |
Plays the AnimationClip with the specified name.
clipId | The ID of the AnimationClip to play. If NULL, plays the default clip. |
void gameplay::Animation::stop | ( | const char * | clipId = NULL | ) |
Stops the AnimationClip with the specified name.
clipId | The ID of the AnimationClip to stop. If NULL, stops the default clip. |
bool gameplay::Animation::targets | ( | AnimationTarget * | target | ) | const |
Returns true if this animation targets the given AnimationTarget.