Difference between revisions of "StopAnimation"
From The Official Visionaire Studio: Adventure Game Engine Wiki
(Created page with "<div class="toccolours mw-collapsible mw-collapsed" style="background: #f0f0f0; border: 1px dashed darkgrey" width="100%"> <b>Command History</b> <div class="mw-collapsible-co...") |
|||
Line 33: | Line 33: | ||
-- you can of course use variables with animations stored in them instead! | -- you can of course use variables with animations stored in them instead! | ||
local anim = getObject("Animations[animation_name]") | local anim = getObject("Animations[animation_name]") | ||
− | + | stopAnimation(anim) | |
</syntaxhighlight> | </syntaxhighlight> | ||
Revision as of 19:27, 7 March 2013
Command History
Available since v3.7
Allows you to stop any active animation; if the animation is not active then nothing happens!
Syntax:
stopAnimation(animation)
Example 1: basic stop animation method
--[[
!important: you must take care when using this method that you don't have multiple instances of animations with the same name otherwise it will not work correctly!
--]]
-- shortened get animation method; !important: see comment above!
stopAnimation("Animations[animation_name]")
-- full get animation method; !recommended
stopAnimation("Scenes[scene_name].SceneObjects[object_name].ObjectAnimations[animation_name]")
Example 2: stop animation via a variable
-- you can of course use variables with animations stored in them instead!
local anim = getObject("Animations[animation_name]")
stopAnimation(anim)
Arguments
animation: path
The path to the animation to be stopped! ("path"."object"."animation")
Flags: none
Return: none