Class: AnimationClip

AnimationClip

AnimationClip is a resource that contains key frames (time / value pairs). AnimationClip itself has no playback state, but is only used as a shareable data resource. It can be passed to AnimationPlayhead or its wrappers (fe: SkeletonClipNode) which will manage the play head position and allow animations.


new AnimationClip()

Author:
  • derschmale <http://www.derschmale.com>
See:

Members


duration

The total duration of the clip, in milliseconds.


looping

Defines whether this clip should repeat or not.


name

The name of the animation clip.


numKeyFrames

The amount of key frames in this clip.

Methods


addKeyFrame(frame)

Adds a keyframe. Last keyframe is usually the same pose as the first and serves as an "end marker"

Parameters:
Name Type Description
frame

A KeyFrame containing a SkeletonPose


getKeyFrame()

Returns the key frame with the given index.


sortKeyFrames()

Sorts the key frames based on their time. Only call this if for some reason the keyframes were added out of order.