LuaLibraryAnimate.wiki
changeset 2236 47493b26d4ee
parent 2235 19ffaf4bf91a
child 2237 dd92ebc28957
equal deleted inserted replaced
2235:19ffaf4bf91a 2236:47493b26d4ee
     3 
     3 
     4 = Lua library: `Animate` =
     4 = Lua library: `Animate` =
     5 <wiki:toc max_depth="2" />
     5 <wiki:toc max_depth="2" />
     6 This library provides functions that aid cinematic/cut-scene creation and functions for handling events.
     6 This library provides functions that aid cinematic/cut-scene creation and functions for handling events.
     7 
     7 
     8 In order to use its full potential, the following lines need to be at the beginning of `onGameTick`.
     8 == Getting started ==
       
     9 
       
    10 In order to use its full potential, the following lines need to be at the beginning of `onGameTick`:
     9 
    11 
    10 <code language="lua">function onGameTick()
    12 <code language="lua">function onGameTick()
    11     AnimUnWait()
    13     AnimUnWait()
    12     if ShowAnimation() == false then
    14     if ShowAnimation() == false then
    13         return
    15         return
    14     end
    16     end
    15     ExecuteAfterAnimations()
    17     ExecuteAfterAnimations()
    16     CheckEvents()
    18     CheckEvents()
    17 end</code>
    19 end</code>
    18 
    20 
    19 Also, `AnimInit()` needs to be called in `onGameInit()`.
    21 Also, `AnimInit()` needs to be called in `onGameInit()`:
       
    22 
       
    23 <code language="lua">function onGameInit()
       
    24     AnimInit()
       
    25 end</code>
       
    26 
    20 Each of these functions will be explained below.
    27 Each of these functions will be explained below.
    21 
    28 
    22 Note: The Animate library will direclty overwrite the input mask with `SetInputMask`. If you already use this function in your script, it might lead to conflicts. Use `AnimSetInputMask` to set the input mask in a manner that is compatible with the Animate library.
    29 Note: The Animate library will directly overwrite the input mask with `SetInputMask`. If you already use this function in your script, it might lead to conflicts. Use `AnimSetInputMask` to set the input mask in a manner that is compatible with the Animate library.
    23 
    30 
    24 == Cinematic handling ==
    31 == Cinematic handling ==
    25 
    32 
    26 === `AnimInit([startAnimating])` ===
    33 === `AnimInit([startAnimating])` ===
    27 Initializes variables used by the other functions. Needs to be called in `onGameInit`.
    34 Initializes variables used by the other functions. Needs to be called in `onGameInit`.