# HG changeset patch # User Wuzzy # Date 1518280758 0 # Node ID fbcd3b2458b85962bcdce343dfb7343825fa4145 # Parent 70628fea6065518eaaa33f6ee238ce4c96cf37d7 LuaAPI: details for SetVisualGearValues diff -r 70628fea6065 -r fbcd3b2458b8 LuaAPI.wiki --- a/LuaAPI.wiki Sat Feb 10 16:28:16 2018 +0000 +++ b/LuaAPI.wiki Sat Feb 10 16:39:18 2018 +0000 @@ -679,29 +679,33 @@ === !SetVisualGearValues(vgUid, X, Y, dX, dY, Angle, Frame, !FrameTicks, State, Timer, Tint) === -This allows manipulation of many of the visual gear values. In the case of `vgtCircle`, the visual gear values are mapped as follows: +This allows manipulation of many of the visual gear values of the visual gear `vgUid`. All visual gear values are numbers. Each visual gear may be using these parameters differently, but the *usual* meaning of these is the following: * `X`, `Y`: Position - * `State`: Radius. - * `Timer`: Thickness - * `FrameTicks`: Pulsation speed (`0` to disable) - * `dX`, `dY`: min/max pulsation opacity (`0`-`255`) + * `dX`, `dY`: Speed along the X and Y axis + * `Angle`: Current rotation + * `Frame`: Image frame, if using a sprite sheet + * `FrameTicks`: ??? + * `State`: Helper value to save some internal state + * `Timer`: Time in milliseconds until it expires * `Tint`: RGBA color -Most visual gears require little to no modification of parameters. +Some visual gears interpret these values differently, just like normal gears. See [VisualGearTypes] for details. Also, most visual gears are not even using some of these values. + +Note that most visual gears require little to no modification of their values. Example 1: -- set a circle to position 1000,1000 pulsing from opacity 20 to 200 (8%-78%), radius of 50, 3px thickness, bright red. SetVisualGearValues(circleUid, 1000,1000, 20, 200, 0, 0, 100, 50, 3, 0xff0000ff) -Beginning from 0.9.21-dev, the 2nd to 11th arguments are optional. Any such argument which is declared as `nil` will not overwrite the corresponding value of the visual gear. With this change, it is not required anymore to call `GetVisualGearValues` beforehand. +Only the first argument is required. Everything else is optional. Any such argument which is declared as `nil` will not overwrite the corresponding value of the visual gear. Example 2: - -- set a circle to position 1000,1000 + -- set a visual gear to position 1000,1000 SetVisualGearValues(circleUid, 1000, 1000) - -- set the color of a circle to bright red. + -- set the tint of a visual gear to bright red. SetVisualGearValues(circleUid, nil, nil, nil, nil, nil, nil, nil, nil, nil, 0xff0000ff)