LuaAPI: PlaceRubber
authorWuzzy
Sun, 27 Nov 2016 04:37:17 +0000
changeset 940 8c4a529edddb
parent 939 39ed0b23ef49
child 941 6100c2308a82
LuaAPI: PlaceRubber
LuaAPI.wiki
--- a/LuaAPI.wiki	Sun Nov 27 00:35:54 2016 +0000
+++ b/LuaAPI.wiki	Sun Nov 27 04:37:17 2016 +0000
@@ -355,31 +355,12 @@
 === <tt>onGirderPlacement(frameIdx, centerX, centerY)</tt> (0.9.21) ===
 This function is called when a girder has been placed.
 
-`frameIdx` is an integer and declares the length and orientation of the girder:
-|| *`frameIdx`* || *Length* || *Orientation* ||
-|| 0 || short || horizontal ||
-|| 1 || short || decreasing right ||
-|| 2 || short || vertical ||
-|| 3 || short || increasing right ||
-|| 4 || long || horizontal ||
-|| 5 || long || decreasing right ||
-|| 6 || long || vertical ||
-|| 7 || long || increasing right ||
-
-`centerX` and `centerY` are the coordinates of the girder’s center.
+`frameIdx` is used for the length and orientation of the girder. The possible values are explained in `PlaceGirder`. `centerX` and `centerY` are the coordinates of the girder’s center.
 
 === <tt>onRubberPlacement(frameIdx, centerX, centerY)</tt> (0.9.21) ===
 This function is called when a rubber has been placed.
 
-`frameIdx` is an integer which stands for the orientation of the rubber.
-
-|| *`frameIdx`* || *Orientation* ||
-|| 0 || horizontal ||
-|| 1 || decreasing right ||
-|| 2 || vertical ||
-|| 3 || increasing right ||
-
-`centerX` and `centerY` are the coordinates of the rubber’s center.
+`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.
 
 == Functions for creating gears ==
 
@@ -991,12 +972,12 @@
 ==== <tt>!TestRectForObstacle(x1, y1, x2, y2, landOnly) (0.9.16) </tt> ====
 Checks the rectangle between the given coordinates for possible collisions. Set `landOnly` to `true` if you don’t want to check for collisions with gears (hedgehogs, etc.).
 
-==== <tt>!PlaceGirder(x, y, state)</tt> (0.9.16) ====
-Attempts to place girder with centre points `x`, `y` and a certain length and orientation, specified by `state`. The girder can only be placed in open space and must not collide with anything so this function may fail. It will return `true` on successful placement and `false` on failure.
+==== <tt>!PlaceGirder(x, y, frameIdx)</tt> (0.9.16) ====
+Attempts to place a girder with centre points `x`, `y` and a certain length and orientation, specified by `frameIdx`. The girder can only be placed in open space and must not collide with anything so this function may fail. It will return `true` on successful placement and `false` on failure.
 
-These are the accepted states:
+These are the accepted values for `frameIdx`:
 
-|| *`state`* || *Length* || *Orientation* ||
+|| *`frameIdx`* || *Length* || *Orientation* ||
 || 0 || short || horizontal ||
 || 1 || short || decreasing right ||
 || 2 || short || vertical ||
@@ -1006,6 +987,17 @@
 || 6 || long || vertical ||
 || 7 || long || increasing right ||
 
+==== <tt>!PlaceRubber(x, y, frameIdx)</tt> (0.9.23) ====
+Attempts to place a rubber with centre points `x`, `y` and a certain orientation, specified by `frameIdx`. The rubber can only be placed in open space and must not collide with anything so this function may fail. It will return `true` on successful placement and `false` on failure.
+
+These are the accepted values for `frameIdx`:
+
+|| *`frameIdx`* || *Orientation* ||
+|| 0 || horizontal ||
+|| 1 || decreasing right ||
+|| 2 || vertical ||
+|| 3 || increasing right ||
+
 ==== <tt>!PlaceSprite(x, y, sprite, frameIdx, tint, behind, flipHoriz, flipVert, [, landFlag, ...])</tt> ====
 Places a [Sprites sprite] at the specified position (`x`, `y`) on the map, it behaves like terrain then. Unlike `PlaceGirder`, this function does not check for collisions, so the sprite can be placed anywhere within map boundaries. The function returns `true` if the placement was successful, `false` otherwise. `frameIdx` is the frame index starting by 0. `frameIdx` is used if the sprite consists of several sub-images. Only a subset of the sprites is currently supported by this function: