Constructor
new AnimationLayer(optionsopt)
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
Options for the animation layer. Properties
|
- Implements:
Members
(readonly) blendMode :string
Gets the type of blending used for states controlled by the layer.
Type:
- string
weight :number
Gets and sets the amount of influence the layer's current animation has over
the result for the host.
Type:
- number
(readonly) weightPending :boolean
Gets whether or not the layer's weight value is currently being animated.
Type:
- boolean
Methods
discard()
Cancel any pending promises and discard states controlled by the layer.
- Implements:
getAnimationBlendNames(animationName) → {Array.<string>}
Returns the names of blend states in an animation.
Parameters:
Name | Type | Description |
---|---|---|
animationName |
string | Name of the animation. |
Returns:
- Names of blend states.
- Type
- Array.<string>
getAnimationBlendWeight(animationName, blendName) → {number}
Returns the weight for a blend state of an animation.
Parameters:
Name | Type | Description |
---|---|---|
animationName |
string | Name of the animation containing the blend state |
blendName |
string | Name of the blend state to retrieve the weight of. |
Returns:
- Weight of the blend state.
- Type
- number
pause() → {boolean}
Pause the current animation state and any interpolation happening on the layer's
weight property.
Returns:
- Type
- boolean
pauseWeight() → {boolean}
Pause any interpolation happening on the layer's weight property.
Returns:
- Type
- boolean
resume() → {boolean}
Resume the current animation state and any interpolation happening on the layer's
weight property.
Returns:
- Type
- boolean
resumeWeight() → {boolean}
Resume any interpolation happening on the layer's weight property.
Returns:
- Type
- boolean
setAnimationBlendWeight(animationName, blendName, weight, secondsopt, easingFnopt) → {Deferred}
Update the weight for a blend state of an animation.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
animationName |
string | Name of the animation containing the blend state |
||
blendName |
string | Name of the blend state to update. |
||
weight |
number | Weight value to set on the animation. This number shoudld be |
||
seconds |
number |
<optional> |
0 | Number of seconds it should take to reach the new weight. |
easingFn |
function |
<optional> |
Easing function to use while interpolating the new |
Returns:
- Promise that will resolve once the animation's weight reaches
the target value.
- Type
- Deferred
setWeight(weight, secondsopt, easingFnopt) → {Deferred}
Updates the user defined weight over time.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
weight |
number | The target weight value. |
||
seconds |
number |
<optional> |
0 | The amount of time it will take to reach the |
easingFn |
function |
<optional> |
The easing function to use for interpolation. |
Returns:
- Type
- Deferred
update(deltaTime)
Update any weight interpolators and the current animation.
Parameters:
Name | Type | Description |
---|---|---|
deltaTime |
number | Time in milliseconds since the last update. |
- Implements:
updateInternalWeight(factor)
Multiplies the user weight by a factor to determine the internal weight.
Parameters:
Name | Type | Description |
---|---|---|
factor |
number | 0-1 multiplier to apply to the user weight. |