Header menu logo Nu

Animation Type

Stores a list of timelines to animate a skeleton's pose over time.

Constructors

Constructor Description

Animation(name, timelines, duration)

Full Usage: Animation(name, timelines, duration)

Parameters:
name : string
timelines : ExposedList<Timeline>
duration : float32

Instance members

Instance member Description

this.Apply

Full Usage: this.Apply

Parameters:
    skeleton : Skeleton - The skeleton the animation is being applied to. This provides access to the bones, slots, and other skeleton components the timelines may change.
    lastTime : float32 - The last time in seconds this animation was applied. Some timelines trigger only at specific times rather than every frame. Pass -1 the first time an animation is applied to ensure frame 0 is triggered.
    time : float32 - The time in seconds the skeleton is being posed for. Most timelines find the frame before and the frame after this time and interpolate between the frame values. If beyond the Animation.Duration and loop is true then the animation will repeat, else the last frame will be applied.
    loop : bool - If true, the animation repeats after the Animation.Duration.
    events : ExposedList<Event> - If any events are fired, they are added to this list. Can be null to ignore fired events or if no timelines fire events.
    alpha : float32 - 0 applies the current or setup values (depending on blend). 1 applies the timeline values. Between 0 and 1 applies values between the current or setup values and the timeline values. By adjusting alpha over time, an animation can be mixed in or out. alpha can also be useful to apply animations on top of each other (layering).
    blend : MixBlend - Controls how mixing is applied when alpha < 1.
    direction : MixDirection - Indicates whether the timelines are mixing in or out. Used by timelines which perform instant transitions, such as DrawOrderTimeline or AttachmentTimeline.

Applies the animation's timelines to the specified skeleton.

skeleton : Skeleton

The skeleton the animation is being applied to. This provides access to the bones, slots, and other skeleton components the timelines may change.

lastTime : float32

The last time in seconds this animation was applied. Some timelines trigger only at specific times rather than every frame. Pass -1 the first time an animation is applied to ensure frame 0 is triggered.

time : float32

The time in seconds the skeleton is being posed for. Most timelines find the frame before and the frame after this time and interpolate between the frame values. If beyond the Animation.Duration and loop is true then the animation will repeat, else the last frame will be applied.

loop : bool

If true, the animation repeats after the Animation.Duration.

events : ExposedList<Event>

If any events are fired, they are added to this list. Can be null to ignore fired events or if no timelines fire events.

alpha : float32

0 applies the current or setup values (depending on blend). 1 applies the timeline values. Between 0 and 1 applies values between the current or setup values and the timeline values. By adjusting alpha over time, an animation can be mixed in or out. alpha can also be useful to apply animations on top of each other (layering).

blend : MixBlend

Controls how mixing is applied when alpha < 1.

direction : MixDirection

Indicates whether the timelines are mixing in or out. Used by timelines which perform instant transitions, such as DrawOrderTimeline or AttachmentTimeline.

this.Duration

Full Usage: this.Duration

The duration of the animation in seconds, which is usually the highest time of all frames in the timeline. The duration is
            used to know when it has completed and when it should loop back to the start.

this.HasTimeline

Full Usage: this.HasTimeline

Parameters:
    propertyIds : string[]

Returns: bool

Returns true if this animation contains a timeline with any of the specified property IDs.

propertyIds : string[]
Returns: bool

this.Name

Full Usage: this.Name

Returns: string

The animation's name, which is unique across all animations in the skeleton.

Returns: string

this.SetTimelines

Full Usage: this.SetTimelines

Parameters:
timelines : ExposedList<Timeline>

this.Timelines

Full Usage: this.Timelines

this.ToString

Full Usage: this.ToString

Returns: string
Modifiers: abstract
Returns: string

Type something to start searching.