# HG changeset patch # User almikes@aol.com # Date 1422218273 0 # Node ID 27add396065dfd28fc746ec9029fd88e2672f992 # Parent 67b07976879699846d1f1c68cc1b951223a8b614 Update SetVisualGearValues diff -r 67b079768796 -r 27add396065d LuaAPI.wiki --- a/LuaAPI.wiki Sat Jan 24 04:14:40 2015 +0000 +++ b/LuaAPI.wiki Sun Jan 25 20:37:53 2015 +0000 @@ -503,8 +503,8 @@ === !GetVisualGearValues(vgUid) === This returns the typically set visual gear values, useful if manipulating things like smoke or bubbles or circles. It returns the following values: -X, Y, dX, dY, Angle, Frame, FrameTicks, State, Timer, Tint -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 and Tint is the colour. +X, Y, dX, dY, Angle, Frame, !FrameTicks, State, Timer, Tint +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 and Tint is the colour. Most visual gears require little to no modification of parameters. Example: @@ -555,8 +555,17 @@ Example: -- 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) - + 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. + +Examples: + + -- set a circle to position 1000,1000 + SetVisualGearValues(circleUid, 1000, 1000) + -- set the color of a circle to bright red. + SetVisualGearValues(circleUid, nil, nil, nil, nil, nil, nil, nil, nil, nil, 0xff0000ff) + === !FindPlace(gearUid, fall, left, right, tryHarder) (0.9.16) === Finds a place for the specified gear between x=`left` and x=`right` and places it there. 0.9.16 adds an optional fifth parameter, `tryHarder`. Setting to `true`/`false` will determine whether the engine attempts to make additional passes, even attempting to place gears on top of each other.