LuaAPI.wiki
changeset 136 538adf2596b5
parent 135 124b11219537
child 137 dd7605730ec5
equal deleted inserted replaced
135:124b11219537 136:538adf2596b5
   314 
   314 
   315 <code lang="lua">  -- set a circle to position 1000,1000 pulsing from opacity 20 to 200 (8%-78%), radius of 50, 3px thickness, bright red.
   315 <code lang="lua">  -- set a circle to position 1000,1000 pulsing from opacity 20 to 200 (8%-78%), radius of 50, 3px thickness, bright red.
   316     !SetVisualGearValues(circleUid, 1000,1000, 20, 200, 0, 0, 100, 50, 3, 0xff0000ff)
   316     !SetVisualGearValues(circleUid, 1000,1000, 20, 200, 0, 0, 100, 50, 3, 0xff0000ff)
   317 </code>
   317 </code>
   318 
   318 
   319 === <tt>!FindPlace(gearUid, fall, left, right)</tt> ===
   319 === <tt>!FindPlace(gearUid, fall, left, right, tryHarder) (0.9.16)</tt> ===
   320 
   320 
   321 <blockquote>Finds a place for the specified gear between x=left and x=right and places it there.
   321 <blockquote>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.
   322 </blockquote>
   322 </blockquote>
   323 Example:
   323 Example:
   324 
   324 
   325 <code lang="lua">    gear = !AddGear(…)
   325 <code lang="lua">    gear = !AddGear(…)
   326     !FindPlace(gear, true, 0, LAND_WIDTH) -- places the gear randomly between 0 and LAND_WIDTH</code>
   326     !FindPlace(gear, true, 0, LAND_WIDTH) -- places the gear randomly between 0 and LAND_WIDTH</code>