LuaLibraryAnimate.wiki
changeset 1382 8d6310a05033
parent 1374 ec15ffae2f19
child 1383 75735c1890c7
equal deleted inserted replaced
1381:6695b6e1d39a 1382:8d6310a05033
    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()` ===
       
    29 *UNDOCUMENTED!*
       
    30 
    28 === `AddAnim(steps)` ===
    31 === `AddAnim(steps)` ===
    29 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`.
    30 
    33 
    31   * `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.
    32 
    35 
    87 
    90 
    88 == Cinematic functions ==
    91 == Cinematic functions ==
    89 
    92 
    90 === `AnimSwitchHog(gear)` ===
    93 === `AnimSwitchHog(gear)` ===
    91 Switches to `gear` and follows it.
    94 Switches to `gear` and follows it.
       
    95 
       
    96 === `AnimGiveState(gear, state)` ===
       
    97 Adds the [GearStates gear state] `state` to `gear`.
       
    98 
       
    99 === `AnimRemoveState(gear, state)` ===
       
   100 Removes the [GearStates gear state] `state` from `gear`.
    92 
   101 
    93 === `AnimWait(gear, time)` ===
   102 === `AnimWait(gear, time)` ===
    94 Increases the wait time by `time`. `gear` is just for compatibility with `ShowAnimation`.
   103 Increases the wait time by `time`. `gear` is just for compatibility with `ShowAnimation`.
    95 
   104 
    96 === `AnimSay(gear, text, manner, time` ===
   105 === `AnimSay(gear, text, manner, time` ===
   211 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.
   220 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.
   212 
   221 
   213 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`.
   222 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`.
   214 
   223 
   215 If you call `SetInputMask` directly, note that it might get quickly overwritten by the Animatel library!
   224 If you call `SetInputMask` directly, note that it might get quickly overwritten by the Animatel library!
       
   225 
       
   226 == Misc. ==
       
   227 
       
   228 === `StoppedGear(gear)` ===
       
   229 Returns `true` if the gear is considered to be resting (not moving). (dX and dY are very small) or if the gear does not exist.