sb.animationGetState
sb.animationGetState(name, id)
Get the current state of an animation. Possible states are:
| State | Description |
|---|---|
sb.ANIMATION_STATE_NOT_FOUND | The animation does not exist. |
sb.ANIMATION_STATE_NOT_RUNNING | The animation exists but is not currently running. |
sb.ANIMATION_STATE_PAUSED | The animation is running but not currently updating values. |
sb.ANIMATION_STATE_RUNNING | The animation is running and updating values. |
sb.ANIMATION_STATE_COMPLETE | The animation has finished running. |
This function does not differentiate between an animation that has reached completion and performed a cleanup and an animation that has not started.
Parameters
| Parameter | Type | Description |
|---|---|---|
name | string | The original name of the animation |
id | string | If the animation was triggered with a specific id, this can be used to find the specific instance of a running animation. |
Returns
| Type | Description |
|---|---|
object | An object with state and progress variables. The state variable is one of sb.ANIMATION_STATE_NOT_FOUND, sb.ANIMATION_STATE_NOT_RUNNING, sb.ANIMATION_STATE_PAUSED, sb.ANIMATION_STATE_RUNNING. The progress variable is a number between 0-1 which describes the current progress of the animation. |