Class: LayeredAnimation

LayeredAnimation


new LayeredAnimation()

LayeredAnimation combines a bunch of AnimationLayer objects into a single manageable animation. This acts globally, so it's not a Component belonging to an Entity

Members


looping

Determines whether the animation should loop or not. By default, it uses the value determined by the AnimationClip, but can be overridden.


name

The name of the animation.


time

The current time in milliseconds of the play head.


timeScale

A value to control the playback speed.

Methods


_update(dt)

This needs to be called every frame.

Parameters:
Name Type Description
dt

The time passed since last frame in milliseconds.


addLayer(layer)

Adds a layer to the animation

Parameters:
Name Type Description
layer

play()

Starts playback of the animation


removeLayer(layer)

Removes a layer from the animation

Parameters:
Name Type Description
layer

stop()

Stops playback of the animation