|  | overview |  | wiki |  | api reference |  | download

- Main Page
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Functions Variables Typedefs Enumerations Enumerator
Classes | Public Member Functions
gameplay::Animation Class Reference

`#include <Animation.h>`

Inheritance diagram for gameplay::Animation:

List of all members.

## 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

## Detailed Description

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.

See also:
  http://gameplay3d.github.io/GamePlay/docs/file-formats.html#wiki-Animation

## Member Function Documentation

AnimationClip* gameplay::Animation::createClip | ( | const char * | id,
|  | unsigned long | begin,
|  | unsigned long | end
| ) |  |

Creates an AnimationClip from the Animation.

Parameters:

  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).

Returns:
  The newly created AnimationClip; NULL if an AnimationClip already exists with the same ID.

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).

Parameters:

  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.

Parameters:

  clipId | The ID of the AnimationClip to get.

Returns:
  The AnimationClip with the specified ID; NULL if an AnimationClip with the given ID is not found.

AnimationClip* gameplay::Animation::getClip | ( | unsigned int | index | ) | const

Returns the AnimationClip at the given index.

Parameters:

  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

Gets the Animation's duration.

Returns:
  The Animation's duration (in milliseconds).

const char* gameplay::Animation::getId | ( |  | ) | const

Gets the Animation's ID.

Returns:
  The Animation's ID.

void gameplay::Animation::pause | ( | const char * | clipId = `NULL` | ) |

Pauses the AnimationClip with the specified name.

Parameters:

  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.

Parameters:

  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.

Parameters:

  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.

All Classes Functions Variables Typedefs Enumerations Enumerator