LuaAPI.wiki
changeset 1223 868b783afc88
parent 1221 16391ff5e091
child 1224 90c14fae29f2
equal deleted inserted replaced
1222:111d15f81dbd 1223:868b783afc88
   376 === <tt>onRubberPlacement(frameIdx, centerX, centerY)</tt> (0.9.21) ===
   376 === <tt>onRubberPlacement(frameIdx, centerX, centerY)</tt> (0.9.21) ===
   377 This function is called when a rubber has been placed.
   377 This function is called when a rubber has been placed.
   378 
   378 
   379 `frameIdx` is used for the rubber orientation. The possible values are explained in `PlaceRubber`. `centerX` and `centerY` are the coordinates of the rubber’s center.
   379 `frameIdx` is used for the rubber orientation. The possible values are explained in `PlaceRubber`. `centerX` and `centerY` are the coordinates of the rubber’s center.
   380 
   380 
       
   381 === `onSpecialPoint(x, y, flags)` ===
       
   382 This is used while a special hand-drawn map is loaded. The engine is building these hand-drawn maps by reading points from the map definition. Optionally, some of these points may be “special”. These are not actually drawn on the map, but are used to store additional information for a position on the map. Special points currently need to be added manually in the map, the in-game editor is not able to add those yet (as of 0.9.23).
       
   383 Now, when such a special point at the coordinates `x` and `y` with an assigned value of `flags` is added, this function is called. `flags` is a whole number between `0` and `255` inclusive.
       
   384 
       
   385 This function is used in Racer and !TechRacer to define waypoints.
       
   386 
   381 == Functions for creating gears ==
   387 == Functions for creating gears ==
   382 
   388 
   383 === <tt>!AddGear(x, y, gearType, state, dx, dy, timer)</tt> ===
   389 === <tt>!AddGear(x, y, gearType, state, dx, dy, timer)</tt> ===
   384 This creates a new gear at position x,y (measured from top left) of kind `gearType` (see [GearTypes Gear Types]). The initial velocities are `dx` and `dy`. All arguments are numbers. The function returns the `uid` of the gear created. Gears can have multple states at once: `state` is a bitmask, the flag variables can be found in [States].
   390 This creates a new gear at position x,y (measured from top left) of kind `gearType` (see [GearTypes Gear Types]). The initial velocities are `dx` and `dy`. All arguments are numbers. The function returns the `uid` of the gear created. Gears can have multple states at once: `state` is a bitmask, the flag variables can be found in [States].
   385 
   391