LuaLibraryAnimate.wiki
changeset 2244 e8e1c0dd32e5
parent 2243 e58371e25834
child 2245 3e97c75aaddc
equal deleted inserted replaced
2243:e58371e25834 2244:e8e1c0dd32e5
    38 
    38 
    39 The step is the primary data structure of this library. A step is a single action in an animation specified in table form. A step table must have the following fields:
    39 The step is the primary data structure of this library. A step is a single action in an animation specified in table form. A step table must have the following fields:
    40 
    40 
    41  * `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 could theoretically be any function, but usually you want to use one of the cinematic functions here.
    41  * `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 could theoretically be any function, but usually you want to use one of the cinematic functions here.
    42  * `args` is a list containing the arguments that need to be passed to the function given, in the same order
    42  * `args` is a list containing the arguments that need to be passed to the function given, in the same order
    43  * `swh` is an optional boolean value that defaults to `true` and denotes whether the current hedgehog should be switched to the hog given as argument 1 in `args`. You *must* set this to `false` if argument 1 is not a hog or the argument list is empty.
    43  * `swh` is an optional boolean value that defaults to `true` and denotes whether the current hedgehog should be switched to the hog given as argument 1 in `args`. You *must* set this to `false` if argument 1 is not a hedgehog.
    44 
    44 
    45 Example 1:
    45 Example 1:
    46 <code language="lua">
    46 <code language="lua">
    47     -- This calls `AnimSay(myHog, "Snails! SNAILS!", SAY_SAY, 3000)`,
    47     -- This calls `AnimSay(myHog, "Snails! SNAILS!", SAY_SAY, 3000)`,
    48     -- meaning the hedgehog gear `myHog` will say "Snails!" and set the animation delay to 3000 milliseconds
    48     -- meaning the hedgehog gear `myHog` will say "Snails!" and set the animation delay to 3000 milliseconds
   166 Internally, the input mask you provide is simply AND-ed with the input mask used by the Animate library. Otherwise, this function works like `SetInputMask`.
   166 Internally, the input mask you provide is simply AND-ed with the input mask used by the Animate library. Otherwise, this function works like `SetInputMask`.
   167 
   167 
   168 If you call `SetInputMask` directly, note that it might get quickly overwritten by the Animate library!
   168 If you call `SetInputMask` directly, note that it might get quickly overwritten by the Animate library!
   169 
   169 
   170 === Cinematic functions ===
   170 === Cinematic functions ===
   171 These are the functions you can specify in animation steps. In all functions except `AnimWait`, the `gear` argument switches the `CurrentHedgehog` to `gear` and follows it.
   171 These are the functions you can specify in animation steps. In all functions except `AnimWait`, the `gear` argument switches the `CurrentHedgehog` to `gear` and follows it. Hedgehog switching can be disabled with `swh=false` (see definition of animation steps above).
   172 
   172 
   173 ==== `AnimSwitchHog(gear)` ====
   173 ==== `AnimSwitchHog(gear)` ====
   174 Switches the `CurrentHedgehog` to `gear` and follows it.
   174 Switches the `CurrentHedgehog` to `gear` and follows it.
       
   175 
       
   176 ==== `AnimFollowGear(gear)` ====
       
   177 Follows `gear`.
   175 
   178 
   176 ==== `AnimGiveState(gear, state)` ====
   179 ==== `AnimGiveState(gear, state)` ====
   177 Sets the [States gear state] of `gear` to `state` (full bitmask).
   180 Sets the [States gear state] of `gear` to `state` (full bitmask).
   178 
   181 
   179 ==== `AnimRemoveState(gear, state)` ====
   182 ==== `AnimRemoveState(gear, state)` ====