Difference between revisions of "StartAnimation"

From The Official Visionaire Studio: Adventure Game Engine Wiki
Line 1: Line 1:
<div class="toccolours mw-collapsible mw-collapsed" style="background: #f0f0f0; border: 1px dashed darkgrey" width="100%">
+
<div class="toccolours mw-collapsible mw-collapsed tbl-ds">
<b>Command History</b>
+
<span class="bold">Command History</span>
 
<div class="mw-collapsible-content">
 
<div class="mw-collapsible-content">
<div style="background:#ebebeb" width="100%">Available since <span style="color:orange">v3.7</span></div>
+
<div class="alt-bg">Available since v3.7</div>
 
</div></div>
 
</div></div>
  
Line 18: Line 18:
 
<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!
+
!important: you must take care when using this method that there is only instance of the animation you are calling.
 
--]]
 
--]]
  
Line 45: Line 45:
  
  
<b><u>Arguments</u></b>
+
<span class="bold underline">Arguments</span>
  
<b>animation</b>: path <br/>
+
<span class="bold">animation</span>: path <br/>
 
The path to the animation to be started! ("path"."object"."animation")
 
The path to the animation to be started! ("path"."object"."animation")
  
  
<b><u>Flags</u></b>
+
<span class="bold underline">Flags</span>
  
<b>reverse</b>: bool <br/>
+
<span class="bold">reverse</span>: boolean (true/false) <br/>
 
True will play the animation in reverse, whereas false will play the animation forwards! (false is default)
 
True will play the animation in reverse, whereas false will play the animation forwards! (false is default)
  
  
<b><u>Return</u></b>
+
<span class="bold underline">Return</span>
  
<b>visionaireObject</b> <br/>
+
<span class="bold">visionaireObject</span> <br/>
 
The visionaire object representing the active animation!
 
The visionaire object representing the active animation!
 
{{i18n|StartAnimation}} <br/>
 
{{i18n|StartAnimation}} <br/>
{| style="background: #f0f0f0; border: 1px dashed darkgrey" width="100%"
+
{| class="tbl-ds"
 
|-
 
|-
|<b>Relevant Pages</b>: [[StopAnimation|stopAnimation]]
+
|<span clasS="bold">Relevant Pages</span>: [[StopAnimation|stopAnimation]]
 
|}
 
|}

Revision as of 12:56, 4 April 2013

Command History

Available since v3.7


Allows you to play any animation; if the animation is already playing then the existing animation is returned!


Syntax:

startAnimation(animation, reverse=true/false)


Example 1: basic start animation method (default direction)

--[[
!important: you must take care when using this method that there is only instance of the animation you are calling. 
--]]

-- 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]")

Example 2: basic start animation method (reverse direction)

-- shortened get animation example; !important: see comment in "example 1"!
startAnimation("Animations[animation_name", true)

Example 3: start animation via a variable

-- 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 direction!


Arguments

animation: path
The path to the animation to be started! ("path"."object"."animation")


Flags

reverse: boolean (true/false)
True will play the animation in reverse, whereas false will play the animation forwards! (false is default)


Return

visionaireObject
The visionaire object representing the active animation!


Relevant Pages: stopAnimation