Members
(readonly) currentAnimation :string
Gets the name of the state the layer is currently in control of.
Type:
- string
(readonly) currentState :AbstractState
Gets the state the layer is currently in control of.
Type:
easingFn :function
Gets and sets the default easing function to use when transitioning and
setting weights.
Type:
- function
(readonly) isTransitioning :boolean
Gets whether or not the layer is currently transitioning to a new animation.
Type:
- boolean
(readonly) paused :boolean
Gets whether or not the player is updating states.
Type:
- boolean
transitionTime :number
Gets and sets the default number of seconds it takes to transition to a new
animation.
Type:
- number
Methods
(static) Mixin(BaseClassopt) → {Class}
Creates a class that implements AnimationPlayerInterface and extends
a specified base class.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
BaseClass |
Class |
<optional> |
class{} | The class to extend. |
Returns:
A class that extends BaseClass
and implements AnimationPlayerInterface.
- Type
- Class
cancelAnimation() → {boolean}
Cancel playback of the current animation.
Returns:
- Type
- boolean
discard()
Discard the transition state.
pauseAnimation() → {boolean}
Pause playback of the current animation.
Returns:
- Type
- boolean
playAnimation(name, transitionTimeopt, easingFnopt, onFinishopt, onErroropt, onCancelopt, onNextopt) → {Deferred}
Start playback an animation from the beginning.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
name |
string | Name of the animation to play. |
|
transitionTime |
number |
<optional> |
Amount of time it will take before the |
easingFn |
function |
<optional> |
Easing function to use for blending if transitionTime |
onFinish |
function |
<optional> |
Function to execute when the animation finishes. |
onError |
function |
<optional> |
Function to execute if the animation encounters |
onCancel |
function |
<optional> |
Function to execute if playback is canceled. |
onNext |
function |
<optional> |
Function to execute if an animation queue is |
Returns:
- Type
- Deferred
resumeAnimation(nameopt, transitionTimeopt, onFinishopt, onErroropt, onCancelopt, onNextopt) → {Deferred}
Resume playback of an animation.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
name |
string |
<optional> |
Name of the animation to resume playback for. Default |
transitionTime |
number |
<optional> |
Amount of time it will take before the |
onFinish |
function |
<optional> |
Function to execute when the state finishes. |
onError |
function |
<optional> |
Function to execute if the state encounters |
onCancel |
function |
<optional> |
Function to execute if playback is canceled. |
onNext |
function |
<optional> |
Function to execute if an animation queue is |
Returns:
- Type
- Deferred
stopAnimation() → {boolean}
Stop playback of the current animation.
Returns:
- Type
- boolean
update(deltaTime)
Update the current animation.
Parameters:
Name | Type | Description |
---|---|---|
deltaTime |
number | Time in milliseconds since the last update. |