Difference between revisions of "StopAnimation"

From The Official Visionaire Studio: Adventure Game Engine Wiki
Line 1: Line 1:
−
<div class="toccolours mw-collapsible mw-collapsed tbl-ds">
+
==stopAnimation==
−
<span class="bold">Command History</span>
 
−
<div class="mw-collapsible-content">
 
−
<div class="alt-bg">Available since v3.7</div>
 
−
</div></div>
 
  
 +
<div class="command-min-version-info">Available since: <span class="command-min-version">v3.0</span></div>
  
−
Allows you to stop any active animation; if the animation is not active then nothing happens!
+
<div class="command-doc">Stops a running animation. If the animation is preloaded but not active or not active at all then nothing happens.</div>
  
−
 
+
Lua Syntax:
−
Syntax:
+
<pre class="command-syntax">stopAnimation(animation)</pre>
−
<syntaxhighlight>
+
===Arguments===
−
stopAnimation(animation)
+
====animation====
−
</syntaxhighlight>
+
:'''"object path"|"object id"|object''' - Visionaire object which specifies an animation.
−
 
+
===Flags===
−
 
+
===Return Values===
−
Example 1: basic stop animation method
+
None.
 +
===Examples===
 +
Example 1:  
 
<syntaxhighlight>
 
<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]")
 
stopAnimation("Scenes[scene_name].SceneObjects[object_name].ObjectAnimations[animation_name]")
 
</syntaxhighlight>
 
</syntaxhighlight>
−
 
+
Example 2:  
−
Example 2: stop animation via a variable
 
 
<syntaxhighlight>
 
<syntaxhighlight>
−
-- 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)
 
stopAnimation(anim)
 
</syntaxhighlight>
 
</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]]
 
−
|}
 

Revision as of 18:12, 22 November 2013

stopAnimation

Available since: v3.0
Stops a running animation. If the animation is preloaded but not active or not active at all then nothing happens.

Lua Syntax:

stopAnimation(animation)

Arguments

animation

"object path"|"object id"|object - Visionaire object which specifies an animation.

Flags

Return Values

None.

Examples

Example 1:

stopAnimation("Scenes[scene_name].SceneObjects[object_name].ObjectAnimations[animation_name]")

Example 2:

local anim = getObject("Animations[animation_name]")
stopAnimation(anim)