LuaAPI.wiki
changeset 613 50ad270cfcfb
parent 612 376d1dcb3114
child 614 64c94ad363c8
equal deleted inserted replaced
612:376d1dcb3114 613:50ad270cfcfb
   605     end
   605     end
   606 end
   606 end
   607 </code>
   607 </code>
   608 
   608 
   609 === <tt>!SetVisualGearValues(vgUid, X, Y, dX, dY, Angle, Frame, !FrameTicks, State, Timer, Tint)</tt> ===
   609 === <tt>!SetVisualGearValues(vgUid, X, Y, dX, dY, Angle, Frame, !FrameTicks, State, Timer, Tint)</tt> ===
   610 This allows manipulation of many of the visual gear values. Calling `GetVisualGearValues` first is recommended on most visual gears unless you are controlling all the key values. In the case of `vgtCircle`, the visual gear values are mapped as follows.  X, Y: position.  State: radius. Timer: Thickness.  !FrameTicks: pulsation speed (0 to disable).  dX, dY: min/max pulsation opacity (0-255). Tint: colour, RGBA.
   610 This allows manipulation of many of the visual gear values. In the case of `vgtCircle`, the visual gear values are mapped as follows:
       
   611 
       
   612 * `X`, `Y`: Position
       
   613 * `State`: Radius.
       
   614 * `Timer`: Thickness
       
   615 * `FrameTicks`: Pulsation speed (`0` to disable)
       
   616 * `dX`, `dY`: min/max pulsation opacity (`0`-`255`)
       
   617 * `Tint`: Color in RGBA
       
   618 
   611 Most visual gears require little to no modification of parameters.
   619 Most visual gears require little to no modification of parameters.
   612 
   620 
   613 Example:
   621 Example 1:
   614 
   622 
   615 <code language="lua">  -- set a circle to position 1000,1000 pulsing from opacity 20 to 200 (8%-78%), radius of 50, 3px thickness, bright red.
   623 <code language="lua">  -- set a circle to position 1000,1000 pulsing from opacity 20 to 200 (8%-78%), radius of 50, 3px thickness, bright red.
   616     SetVisualGearValues(circleUid, 1000,1000, 20, 200, 0, 0, 100, 50, 3, 0xff0000ff)</code>
   624     SetVisualGearValues(circleUid, 1000,1000, 20, 200, 0, 0, 100, 50, 3, 0xff0000ff)</code>
   617 
   625 
   618 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.
   626 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.
   619 
   627 
   620 Examples:
   628 Example 2:
   621 
   629 
   622 <code language="lua">  -- set a circle to position 1000,1000
   630 <code language="lua">  -- set a circle to position 1000,1000
   623     SetVisualGearValues(circleUid, 1000, 1000)</code>
   631     SetVisualGearValues(circleUid, 1000, 1000)</code>
   624 <code language="lua">  -- set the color of a circle to bright red.
   632 <code language="lua">  -- set the color of a circle to bright red.
   625     SetVisualGearValues(circleUid, nil, nil, nil, nil, nil, nil, nil, nil, nil, 0xff0000ff)</code>
   633     SetVisualGearValues(circleUid, nil, nil, nil, nil, nil, nil, nil, nil, nil, 0xff0000ff)</code>