Difference between revisions of "StopAnimation"

From The Official Visionaire Studio: Adventure Game Engine Wiki
(Redirected page to Global Command: stopAnimation)
 
(3 intermediate revisions by one other user not shown)
Line 1: Line 1:
<div class="toccolours mw-collapsible mw-collapsed tbl-ds">
+
#REDIRECT [[Global Command: stopAnimation]]
<span class="bold">Command History</span>
 
<div class="mw-collapsible-content">
 
<div class="alt-bg">Available since v3.7</div>
 
</div></div>
 
 
 
 
 
Allows you to stop any active animation; if the animation is not active then nothing happens!
 
 
 
 
 
Syntax:
 
<syntaxhighlight>
 
stopAnimation(animation)
 
</syntaxhighlight>
 
 
 
 
 
Example 1: basic stop animation method
 
<syntaxhighlight>
 
--[[
 
!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]")
 
</syntaxhighlight>
 
 
 
Example 2: stop animation via a variable
 
<syntaxhighlight>
 
-- you can of course use variables with animations stored in them instead!
 
local anim = getObject("Animations[animation_name]")
 
stopAnimation(anim)
 
</syntaxhighlight>
 
 
 
 
 
 
 
<span class="bold underline">Arguments</span>
 
 
 
<span class="bold">animation</span>: path <br/>
 
The path to the animation to be stopped! ("path"."object"."animation")
 
 
 
 
 
<span class="bold underline">Flags</span>
 
 
 
none
 
 
 
 
 
<span>Return</span>
 
 
 
none
 
{{i18n|StopAnimation}} <br/>
 
{| class="tbl-ds"
 
|-
 
|<span class="bold">Relevant Pages</span>: [[StartAnimation|startAnimation]]
 
|}
 

Latest revision as of 12:36, 19 May 2023