# HG changeset patch
# User Wuzzy
# Date 1547511703 0
# Node ID c7d3e5459a588041dd5305ee59d6a49e4abbd5ea
# Parent e9a2b9e3306017136001598eeab750bdedff4b45
LuaAPI: Add Scale argument for *VisualGearValues
diff -r e9a2b9e33060 -r c7d3e5459a58 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:
-- 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)
=== !GetVisualGearValues(vgUid) ===
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:
-- 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)
== Functions to modify gears ==
@@ -773,7 +766,7 @@
end
-=== !SetVisualGearValues(vgUid, X, Y, dX, dY, Angle, Frame, !FrameTicks, State, Timer, Tint) ===
+=== !SetVisualGearValues(vgUid, X, Y, dX, dY, Angle, Frame, !FrameTicks, State, Timer, Tint, Scale) ===
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.