Skip to main content
Version: 9.0.2

gre.animation_get_state

gre.animation_get_state(name, [id])

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

  • gre.ANIMATION_NOT_FOUND - The animation does not exist

  • gre.ANIMATION_NOT_RUNNING - The animation is not currently running

  • gre.ANIMATION_PAUSED - The animation is running but is currently paused and not updating data

  • gre.ANIMATION_RUNNING - The animation is running and updating data

  • gre.ANIMATION_COMPLETE - The animation has finished executing

This function does not differentiate between an animation that has reached completion and an animation that has not started.

If the 'id' parameter is specified, the 'name' parameter will only be used if there are no active animation matching the current ID.

Parameters

ParameterTypeDescription
name#stringThe original name of the animation id Either a string id, or table with 'id'.

Returns

TypeDescription
#tableA table with state and context keys state One of gre.ANIMATION_NOT_FOUND, gre.ANIMATION_NOT_RUNNING, gre.ANIMATION_PAUSED, gre.ANIMATION_RUNNING, gre.ANIMATION_COMPLETE
#numberA floating-point number between 0-1 which describes the current progress of the animation.
#booleanA boolen indicating if the animation is currently reversed.
#numberThe total duration of the animation in milliseconds.