LuaAPI: Add Scale argument for *VisualGearValues
authorWuzzy
Tue, 15 Jan 2019 00:21:43 +0000
changeset 1703 c7d3e5459a58
parent 1702 e9a2b9e33060
child 1704 09694f0d4e90
LuaAPI: Add Scale argument for *VisualGearValues
LuaAPI.wiki
--- a/LuaAPI.wiki	Mon Jan 14 16:16:16 2019 +0000
+++ b/LuaAPI.wiki	Tue Jan 15 00:21:43 2019 +0000
@@ -692,22 +692,15 @@
 Example:
 <code language="lua">
 -- Get all values in a single line of code:
-local Angle, Power, WDTimer, Radius, Density, Karma, DirAngle, AdvBounce, ImpactSound, nImpactSounds, Tint, Damage, Boom = GetGearValues(myGear)
+local Angle, Power, WDTimer, Radius, Density, Karma, DirAngle, AdvBounce, ImpactSound, nImpactSounds, Tint, Damage, Boom, Scale = GetGearValues(myGear)
 </code>
 
 === <tt>!GetVisualGearValues(vgUid)</tt> ===
 This returns the typically set visual gear values for the specified visual gear `vgUid`, useful if manipulating things like smoke, bubbles or circles. On success, it returns the following values:
 
-`X, Y, dX, dY, Angle, Frame, FrameTicks, State, Timer, Tint`
+`X, Y, dX, dY, Angle, Frame, FrameTicks, State, Timer, Tint, Scale`
 
- * `X`, `Y`: typically position
- * `dX`, `dY`: typically speed
- * `Angle` is usually the rotation angle
- * `Frame` is typically the animation frame
- * `FrameTicks` is usually an animation counter
- * `State` can have a variety of values, but is typically bit packed
- * `Timer` is usually the gear lifetime
- * `Tint` is the RGBA color
+The meaning of these values is the same as in `SetVisualGearValues`.
 
 If the visual gear does not exist, `nil` is returned. Always check the result for `nil` before you plug in the values anywhere.
 
@@ -716,7 +709,7 @@
 Example:
 
 <code language="lua">-- Return visual gear values
-local X, Y, dX, dY, Angle, Frame, FrameTicks, State, Timer, Tint = GetVisualGearValues(vgUid)
+local X, Y, dX, dY, Angle, Frame, FrameTicks, State, Timer, Tint, Scale = GetVisualGearValues(vgUid)
 </code>
 
 == Functions to modify gears ==
@@ -773,7 +766,7 @@
 end
 </code>
 
-=== <tt>!SetVisualGearValues(vgUid, X, Y, dX, dY, Angle, Frame, !FrameTicks, State, Timer, Tint)</tt> ===
+=== <tt>!SetVisualGearValues(vgUid, X, Y, dX, dY, Angle, Frame, !FrameTicks, State, Timer, Tint, Scale)</tt> ===
 This allows manipulation of the internal state of the visual gear `vgUid`. If `vgUid` is invalid or the `vgUid` does not refer to an existing visual gear, the function does nothing. Thus, you can safely call this function even if you are not sure if the visual gear actually exists.
 
 All visual gear values are numbers. Each visual gear may be using these parameters differently, but the *usual* meaning of these is the following:
@@ -782,10 +775,11 @@
  * `dX`, `dY`: Speed along the X and Y axis
  * `Angle`: Current rotation
  * `Frame`: Image frame, if using a sprite sheet
- * `FrameTicks`: ???
+ * `FrameTicks` is usually an animation counter
  * `State`: Helper value to save some internal state
  * `Timer`: Time in milliseconds until it expires
  * `Tint`: RGBA color
+ * `Scale` is a scale factor (not used by all visual gears)
 
 Some visual gears interpret these values differently, just like normal gears. See [VisualGearTypes] for details.  Also, most visual gears are not using all possible values, while some values are just ignored.