Global Command: stopAnimation

From The Official Visionaire Studio: Adventure Game Engine Wiki
Revision as of 13:08, 3 May 2023 by EK (talk | contribs) (Created page with "Stop a running animation. {| class="ts" |- | style="width:15%" | Related functions | startAnimation |} == Syntax == <syntaxhighlight lang...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Stop a running animation.

Related functions startAnimation


Syntax

stopAnimation(animation)


Parameters

Parameter Type Description
animation TVisObj Visionaire object representing an animation.


Return values

none


Examples

Example 1: Stop an animation.

local myAnimation = Animations["animation_name"]
stopAnimation(myAnimation)


Example 2: Start an animation and stop it after a certain time, depending on a Visionaire value called "duration" holding the amount of seconds.

local myDelay = Values["duration"].Int
myAnimation = Animations["animation_name"]

startAnimation(myAnimation)
setDelay(myDelay * 1000, "stopAnimation(myAnimation)")