LuaLibraryAnimate: Move stuff around
authorWuzzy
Thu, 03 May 2018 00:29:52 +0100
changeset 1384 1edf2e41b626
parent 1383 75735c1890c7
child 1385 93a09090d23f
LuaLibraryAnimate: Move stuff around
LuaLibraryAnimate.wiki
--- a/LuaLibraryAnimate.wiki	Thu May 03 00:25:56 2018 +0100
+++ b/LuaLibraryAnimate.wiki	Thu May 03 00:29:52 2018 +0100
@@ -22,6 +22,29 @@
 
 == Cinematic handling ==
 
+=== `AnimInit([startAnimating])` ===
+Initializes variables used by the other functions. Needs to be called in `onGameInit`.
+
+Since 0.9.23, an optional convenience parameter `startAnimating` is available; if set to `true`, the game will start in “animation” mode which enables cinematic mode and disables all controls except precise for skipping. This is useful if you want to indicate that an animation will be played right at the start and the player must not be allowed to use any controls before the animation is over. If you set this parameter to `true`, you also *must* play at least one animation after this, otherwise the game will be stuck.
+
+=== `AnimInsertStepNext(step)` ===
+Inserts `step` after the current step (read: action) in the cinematic array. Useful when an action depends on variables (e.g. positions). It can be used mostly with `AnimCustomFunction`. Note: In case of multiple consecutive calls, steps need to be added in reverse order.
+
+Example:
+<code language="lua">function BlowHog(deadHog)
+  AnimInsertStepNext({func = DeleteGear, args = {deadHog}, swh = false})
+  AnimInsertStepNext({func = AnimVisualGear, args = {deadHog, GetX(deadHog), GetY(deadHog), vgtBigExplosion, 0, true}, swh = false})
+  AnimInsertStepNext({func = AnimWait, args = {deadHog, 1200}})
+  AnimInsertStepNext({func = AnimVisualGear, args = {deadHog, GetX(deadHog) + 20, GetY(deadHog), vgtExplosion, 0, true}, swh = false})
+  AnimInsertStepNext({func = AnimWait, args = {deadHog, 100}})
+  AnimInsertStepNext({func = AnimVisualGear, args = {deadHog, GetX(deadHog) + 10, GetY(deadHog), vgtExplosion, 0, true}, swh = false})
+  AnimInsertStepNext({func = AnimWait, args = {deadHog, 100}})
+  AnimInsertStepNext({func = AnimVisualGear, args = {deadHog, GetX(deadHog) - 10, GetY(deadHog), vgtExplosion, 0, true}, swh = false})
+  AnimInsertStepNext({func = AnimWait, args = {deadHog, 100}})
+  AnimInsertStepNext({func = AnimVisualGear, args = {deadHog, GetX(deadHog) - 20, GetY(deadHog), vgtExplosion, 0, true}, swh = false})
+end
+cinem = {{func = AnimCustomFunction, args = {liveHog, BlowHog, {deadHog}}}}</code>
+
 === `ShowAnimation()` ===
 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)`.
 
@@ -80,14 +103,16 @@
 === `RemoveFunction()` ===
 Removes the first function from the aforementioned list.
 
-=== `AnimInit([startAnimating])` ===
-Initializes variables used by the other functions. Needs to be called in `onGameInit`.
-
-Since 0.9.23, an optional convenience parameter `startAnimating` is available; if set to `true`, the game will start in “animation” mode which enables cinematic mode and disables all controls except precise for skipping. This is useful if you want to indicate that an animation will be played right at the start and the player must not be allowed to use any controls before the animation is over. If you set this parameter to `true`, you also *must* play at least one animation after this, otherwise the game will be stuck.
-
 === `AnimUnWait()` ===
 Decreases the wait time used by cinematics. It is best called in `onGameTick`.
 
+=== `AnimSetInputMask(inputMask)` ===
+Call this function instead of `SetInputMask` if you want to set the input mask in a way that does not conflict with the Animate library.
+
+Internally, the input mask you provide is simply AND-ed with the input mask used by the Animate library. Otherwise, this function works lik `SetInputMask`.
+
+If you call `SetInputMask` directly, note that it might get quickly overwritten by the Animatel library!
+
 == Cinematic functions ==
 
 === `AnimSwitchHog(gear)` ===
@@ -157,24 +182,6 @@
 
 cinem = {{func = AnimCustomFunction, args = {hog1, NeedToTurn, {hog1, hg2}}}}</code>
 
-=== `AnimInsertStepNext(step)` ===
-Inserts `step` after the current step (read: action) in the cinematic array. Useful when an action depends on variables (e.g. positoins). It can be used mostly with `AnimCustomFunction`. Note: In case of multiple consecutive calls, steps need to be added in reverse order.
-
-Example:
-<code language="lua">function BlowHog(deadHog)
-  AnimInsertStepNext({func = DeleteGear, args = {deadHog}, swh = false})
-  AnimInsertStepNext({func = AnimVisualGear, args = {deadHog, GetX(deadHog), GetY(deadHog), vgtBigExplosion, 0, true}, swh = false})
-  AnimInsertStepNext({func = AnimWait, args = {deadHog, 1200}})
-  AnimInsertStepNext({func = AnimVisualGear, args = {deadHog, GetX(deadHog) + 20, GetY(deadHog), vgtExplosion, 0, true}, swh = false})
-  AnimInsertStepNext({func = AnimWait, args = {deadHog, 100}})
-  AnimInsertStepNext({func = AnimVisualGear, args = {deadHog, GetX(deadHog) + 10, GetY(deadHog), vgtExplosion, 0, true}, swh = false})
-  AnimInsertStepNext({func = AnimWait, args = {deadHog, 100}})
-  AnimInsertStepNext({func = AnimVisualGear, args = {deadHog, GetX(deadHog) - 10, GetY(deadHog), vgtExplosion, 0, true}, swh = false})
-  AnimInsertStepNext({func = AnimWait, args = {deadHog, 100}})
-  AnimInsertStepNext({func = AnimVisualGear, args = {deadHog, GetX(deadHog) - 20, GetY(deadHog), vgtExplosion, 0, true}, swh = false})
-end
-cinem = {{func = AnimCustomFunction, args = {liveHog, BlowHog, {deadHog}}}}</code>
-
 == Event handling ==
 
 Events are pairs of functions that are used to check for various conditions. One of them is for verification and, if it returns `true`, the second function is called.
@@ -216,13 +223,6 @@
 === `CheckEvents` ===
 Verifies all the condition functions in the events list and calls the respective ‘action’ functions if the conditions are met. If the `evType` of a completed event equals `0` then it is removed from the list. This function is best placed in `onGameTick`.
 
-=== `AnimSetInputMask(inputMask)` (0.9.23) ===
-Call this function instead of `SetInputMask` if you want to set the input mask in a way that does not conflict with the Animate library.
-
-Internally, the input mask you provide is simply AND-ed with the input mask used by the Animate library. Otherwise, this function works lik `SetInputMask`.
-
-If you call `SetInputMask` directly, note that it might get quickly overwritten by the Animatel library!
-
 == Misc. ==
 
 === `StoppedGear(gear)` ===