Interface: ManagedAnimationLayerInterface

ManagedAnimationLayerInterface

Class factory interface for that keeps track of layers and animations on a host.
Tracked assets are marked as inactive until layers and animations with matching
names are detected as present on the host.

Properties:
Name Type Description
DEFAULT_LAYER_OPTIONS Object

Default options to use when executing
AnimationLayer methods.

Properties
Name Type Attributes Default Description
blendTime number <optional>
0.5

Default time in seconds
to use when executing AnimationLayer.setBlendWeight.

animations Object <optional>
{}

Maps animation names
to default options objects to use for managed animations.

Extends

Methods

(static) Mixin(BaseClass) → {Class}

Creates a class that implements ManagedAnimationLayerInterface
and extends a specified base class.

Parameters:
Name Type Description
BaseClass Class

The class to extend.

Returns:

A class that extends BaseClass and implements ManagedAnimationLayerInterface.

Type
Class

disable(secondsopt, easingFnopt)

Set all tracked layers' weights to 0.

Parameters:
Name Type Attributes Description
seconds number <optional>

Number of seconds it will take to reach the weight
on each layer. If undefined, each layers' blendTime option is used.

easingFn function <optional>

Easing function to use when setting weight
on each layer. If undefined, each layers' easingFn option is used.

discard()

Inherited From:

enable(secondsopt, easingFnopt)

Set all tracked layers' weights to 1.

Parameters:
Name Type Attributes Description
seconds number <optional>

Number of seconds it will take to reach the weight
on each layer. If undefined, each layers' blendTime option is used.

easingFn function <optional>

Easing function to use when setting weight
on each layer. If undefined, each layers' easingFn option is used.

registerAnimation(layerName, animationName, optionsopt)

Start tracking keeping track of whether an animation with the given name is
present on the host.

Parameters:
Name Type Attributes Description
layerName string

Name of the layer that will own the animation.

animationName string

Name of the animation to keep track of.

options Object <optional>

Options for the animation.

registerLayer(name, optionsopt)

Start tracking keeping track of whether a layer with the given name is present
on the host.

Parameters:
Name Type Attributes Description
name string

Name of the layer to keep track of.

options Object <optional>

Options for the layer.

Properties
Name Type Attributes Description
blendTime number <optional>

Default amount of time to use when
manipulating layer weights on this layer.

easingFn function <optional>

Default easing function to use when
manipulating layer weights on this layer.

animations Object <optional>

Animations to keep track of on the layer.
Animations are represented as key/value pairs of animation names and their
options.

setLayerWeights(nameFilteropt, weight, secondsopt, easingFnopt)

Set layer weights on tracked layers.

Parameters:
Name Type Attributes Description
nameFilter function <optional>

Predicate function to test each tracked layer
with. By default all layers will pass.

weight number

Weight value to set on layers.

seconds number <optional>

Number of seconds it will take to reach the weight
on each layer. If undefined, each layers' blendTime option is used.

easingFn function <optional>

Easing function to use when setting weight
on each layer. If undefined, each layers' easingFn option is used.