LuaAPI.wiki
changeset 615 632e4dcc8b52
parent 614 64c94ad363c8
child 616 51fafc27af9c
equal deleted inserted replaced
614:64c94ad363c8 615:632e4dcc8b52
   533 This is returned (all variables are integers):
   533 This is returned (all variables are integers):
   534 
   534 
   535 `Angle, Power, WDTimer, Radius, Karma, DirAngle, AdvBounce, ImpactSound, nImpactSounds, Tint`
   535 `Angle, Power, WDTimer, Radius, Karma, DirAngle, AdvBounce, ImpactSound, nImpactSounds, Tint`
   536 
   536 
   537 A rough description of some of the parameters:
   537 A rough description of some of the parameters:
   538 * `Radius`: Effect or collision radius, most of the time
   538 
   539 * `ImpactSound`: Sound it makes on a collision (see [[Sounds]])
   539  * `Radius`: Effect or collision radius, most of the time
   540 * `Tint`: Used by some gear types to determine its colorization. The color is in RGBA format.
   540  * `ImpactSound`: Sound it makes on a collision (see [[Sounds]])
       
   541  * `Tint`: Used by some gear types to determine its colorization. The color is in RGBA format.
   541 
   542 
   542 Example:
   543 Example:
   543 <code language="lua">
   544 <code language="lua">
   544 -- Get all 12 values in a single line of code:
   545 -- Get all 12 values in a single line of code:
   545 local Angle, Power, WDTimer, Radius, Karma, DirAngle, AdvBounce, ImpactSound, nImpactSounds, Tint = GetGearValues(myGear)
   546 local Angle, Power, WDTimer, Radius, Karma, DirAngle, AdvBounce, ImpactSound, nImpactSounds, Tint = GetGearValues(myGear)
   548 === <tt>!GetVisualGearValues(vgUid)</tt> ===
   549 === <tt>!GetVisualGearValues(vgUid)</tt> ===
   549 This returns the typically set visual gear values, useful if manipulating things like smoke or bubbles or circles. It returns the following values:
   550 This returns the typically set visual gear values, useful if manipulating things like smoke or bubbles or circles. It returns the following values:
   550 
   551 
   551 `X, Y, dX, dY, Angle, Frame, FrameTicks, State, Timer, Tint`
   552 `X, Y, dX, dY, Angle, Frame, FrameTicks, State, Timer, Tint`
   552 
   553 
   553 * `X`, `Y`: typically position
   554  * `X`, `Y`: typically position
   554 * `dX`, `dY`: typically speed
   555  * `dX`, `dY`: typically speed
   555 * `Angle` is usually the rotation angle
   556  * `Angle` is usually the rotation angle
   556 * `Frame` is typically the animation frame
   557  * `Frame` is typically the animation frame
   557 * `FrameTicks` is usually an animation counter
   558  * `FrameTicks` is usually an animation counter
   558 * `State` can have a variety of values, but is typically bit packed
   559  * `State` can have a variety of values, but is typically bit packed
   559 * `Timer` is usually the gear lifetime
   560  * `Timer` is usually the gear lifetime
   560 * `Tint` is the RGBA color
   561  * `Tint` is the RGBA color
   561 
   562 
   562 Most visual gears require little to no modification of parameters.
   563 Most visual gears require little to no modification of parameters.
   563 
   564 
   564 Example:
   565 Example:
   565 
   566 
   617 </code>
   618 </code>
   618 
   619 
   619 === <tt>!SetVisualGearValues(vgUid, X, Y, dX, dY, Angle, Frame, !FrameTicks, State, Timer, Tint)</tt> ===
   620 === <tt>!SetVisualGearValues(vgUid, X, Y, dX, dY, Angle, Frame, !FrameTicks, State, Timer, Tint)</tt> ===
   620 This allows manipulation of many of the visual gear values. In the case of `vgtCircle`, the visual gear values are mapped as follows:
   621 This allows manipulation of many of the visual gear values. In the case of `vgtCircle`, the visual gear values are mapped as follows:
   621 
   622 
   622 * `X`, `Y`: Position
   623  * `X`, `Y`: Position
   623 * `State`: Radius.
   624  * `State`: Radius.
   624 * `Timer`: Thickness
   625  * `Timer`: Thickness
   625 * `FrameTicks`: Pulsation speed (`0` to disable)
   626  * `FrameTicks`: Pulsation speed (`0` to disable)
   626 * `dX`, `dY`: min/max pulsation opacity (`0`-`255`)
   627  * `dX`, `dY`: min/max pulsation opacity (`0`-`255`)
   627 * `Tint`: Color in RGBA
   628  * `Tint`: RGBA color
   628 
   629 
   629 Most visual gears require little to no modification of parameters.
   630 Most visual gears require little to no modification of parameters.
   630 
   631 
   631 Example 1:
   632 Example 1:
   632 
   633