Difference between revisions of "StartAnimation"

From The Official Visionaire Studio: Adventure Game Engine Wiki
(Redirected page to Global Command: startAnimation)
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<div class="toccolours mw-collapsible mw-collapsed" style="background: #f0f0f0; border: 1px dashed darkgrey" width="100%">
+
#REDIRECT [[Global Command: startAnimation]]
<b>Command History</b>
 
<div class="mw-collapsible-content">
 
<div style="background:#ebebeb" width="100%">Available since <span style="color:orange">v3.7</span></div>
 
</div></div>
 
 
 
 
 
Allows you to play any animation; if the animation is already playing then the existing animation is returned!
 
 
 
 
 
Syntax:
 
<syntaxhighlight>
 
startAnimation(animation, reverse=true/false)
 
</syntaxhighlight>
 
 
 
 
 
Example 1: basic start animation method (default direction)
 
<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!
 
startAnimation("Animations[animation_name]")
 
 
 
 
 
-- full get animation method; !recommended
 
startAnimation("Scenes[scene_name].SceneObjects[object_name].ObjectAnimations[animation_name]")
 
</syntaxhighlight>
 
 
 
Example 2: basic start animation method (reverse/inverse direction)
 
<syntaxhighlight>
 
-- shortened get animation example; !important: see comment in "example 1"!
 
startAnimation("Animations[animation_name", true)
 
</syntaxhighlight>
 
 
 
Example 3: start animation via a variable
 
<syntaxhighlight>
 
-- you can of course use variables with animations stored in them instead!
 
local anim = getObject("Animations[animation_name]")
 
startAnimation(anim) -- default direction!
 
startAnimation(anim, true) -- reversed/inverted direction!
 
</syntaxhighlight>
 
 
 
 
 
 
 
<b><u>Arguments</u></b>
 
 
 
<b>animation</b>: path <br/>
 
The path to the animation to be started! ("path"."object"."animation")
 
 
 
 
 
<b><u>Flags</u></b>
 
 
 
none
 
 
 
 
 
<b><u>Return</u></b>
 
 
 
<b>visionaireObject</b> <br/>
 
The visionaire object representing the active animation!
 
{{i18n|StartAnimation}} <br/>
 
{| style="background: #f0f0f0; border: 1px dashed darkgrey" width="100%"
 
|-
 
|<b>Relevant Pages</b>: [[StopAnimation|stopAnimation]]
 
|}
 

Latest revision as of 12:34, 19 May 2023