gre.animation_pause
gre.animation_pause(animation_id, data)
--OR
gre.animation_pause("animation_name")
Pause a running animation. If an animation_id is used to pause the animation, then it must be the return value from gre.animation_create(). If a name is used to pause an animation, then that name must be the name of the animation specified in Designer. This function can take an optional parameter, data_table. The data_table contains the tags and values for the extra arguments to set.
Parameters
| Parameter | Type | Description |
|---|---|---|
animation_id | #string | The running animation to pause |
data | #table | [Optional] A table containing the tags and values for the extra arguments to set (see Animation Data) |
Animation Data
| Parameter | Type | Description |
|---|---|---|
id | #string | The animation id used in the case of multiple animations with the same name |
context | #string | The fully qualified name of an object in the model which will be used as the context for the animation. |
Example
function pause_animation(id)
--Pause the animation
gre.animation_pause(id)
end
--Example of using gre.animation_pause passing animation names.
function cb_pause_cur_5day()
if cur_5day_toggle == false then
gre.animation_pause("show_5day")
else
gre.animation_pause("hide_mon_to_fri")
end
end
--Example of using gre.animation_pause with context.
function cb_pause_cur_5day()
local data = {}
data["context"] = "Layer1.mycontrol"
gre.animation_pause("show_5day", data)
end