equal
deleted
inserted
replaced
1 #summary Lua library documentation of Animate; for cinematics, cut-scenes and other nice animations |
1 #summary Lua library documentation of Animate; for cinematics, cut-scenes and other nice animations |
2 #labels !LuaLibrary |
2 #labels !LuaLibrary |
3 = Lua library: `Animate` = |
3 = Lua library: `Animate` = |
4 |
4 <wiki:toc max_depth="2" /> |
5 This library provides functions that aid cinematic/cut-scene creation and functions for handling events. |
5 This library provides functions that aid cinematic/cut-scene creation and functions for handling events. |
6 |
6 |
7 In order to use its full potential, the following lines need to be at the beginning of `onGameTick`. |
7 In order to use its full potential, the following lines need to be at the beginning of `onGameTick`. |
8 |
8 |
9 <code language="lua">function onGameTick() |
9 <code language="lua">function onGameTick() |
23 == Cinematic handling == |
23 == Cinematic handling == |
24 |
24 |
25 === `ShowAnimation()` === |
25 === `ShowAnimation()` === |
26 Performs the current action in the cinematic and returns `true` if finished, otherwise `false`. It needs to be used in `onGameTick`. Cut-scenes need to be added with `AddAnim(steps)`. |
26 Performs the current action in the cinematic and returns `true` if finished, otherwise `false`. It needs to be used in `onGameTick`. Cut-scenes need to be added with `AddAnim(steps)`. |
27 |
27 |
28 === `Animate()` === |
28 === `Animate(steps)` === |
29 *UNDOCUMENTED!* |
29 *THIS FUNCTION IS UNDOCUMENTED!* |
30 |
30 |
31 === `AddAnim(steps)` === |
31 === `AddAnim(steps)` === |
32 Adds `steps` to the array of animations, where `steps` is a table with numbers as keys and elements of the following form. Each step is a table having the following keys: `func`, `args`, `swh`. |
32 Adds `steps` to the array of animations, where `steps` is a table with numbers as keys and elements of the following form. Each step is a table having the following keys: `func`, `args`, `swh`. |
33 |
33 |
34 * `func` is the function to be executed. It can be any function that returns false when it needs to be called again in following game ticks (e.g. `AnimMove`). It can be one of the cinematic functions. |
34 * `func` is the function to be executed. It can be any function that returns false when it needs to be called again in following game ticks (e.g. `AnimMove`). It can be one of the cinematic functions. |