Skip to main content
Version: 9.0.2

sb.animationGetState

sb.animationGetState(name, id)

Get the current state of an animation. Possible states are:

StateDescription
sb.ANIMATION_STATE_NOT_FOUNDThe animation does not exist.
sb.ANIMATION_STATE_NOT_RUNNINGThe animation exists but is not currently running.
sb.ANIMATION_STATE_PAUSEDThe animation is running but not currently updating values.
sb.ANIMATION_STATE_RUNNINGThe animation is running and updating values.
sb.ANIMATION_STATE_COMPLETEThe 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

ParameterTypeDescription
name stringThe original name of the animation
id stringIf the animation was triggered with a specific id, this can be used to find the specific instance of a running animation.

Returns

TypeDescription
objectAn 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.