author | Wuzzy |
Wed, 17 Apr 2019 00:19:05 +0100 | |
changeset 1735 | 4b658d116488 |
parent 1652 | ff0512443f75 |
child 1826 | 24b348e89a57 |
permissions | -rw-r--r-- |
1373 | 1 |
#summary Lua library documentation of Utils; contains assorted helper functions |
1345 | 2 |
#labels !LuaLibrary |
1331 | 3 |
= Lua library: `Utils` = |
1329
bd781e19a52d
Split Lua libraries into several sub-pages
Wuzzy <almikes@aol.com>
parents:
diff
changeset
|
4 |
|
bd781e19a52d
Split Lua libraries into several sub-pages
Wuzzy <almikes@aol.com>
parents:
diff
changeset
|
5 |
This library includes miscellaneous functions to use, they are all independent of each other and can be used everywhere. |
bd781e19a52d
Split Lua libraries into several sub-pages
Wuzzy <almikes@aol.com>
parents:
diff
changeset
|
6 |
|
1331 | 7 |
== `gearIsInBox(gear, x, y, w, h)` == |
1329
bd781e19a52d
Split Lua libraries into several sub-pages
Wuzzy <almikes@aol.com>
parents:
diff
changeset
|
8 |
|
bd781e19a52d
Split Lua libraries into several sub-pages
Wuzzy <almikes@aol.com>
parents:
diff
changeset
|
9 |
Returns whether the gear is inside (centre point of the gear) a box with x and y as the top left corner and having the width and height of w and h respectively. |
bd781e19a52d
Split Lua libraries into several sub-pages
Wuzzy <almikes@aol.com>
parents:
diff
changeset
|
10 |
|
bd781e19a52d
Split Lua libraries into several sub-pages
Wuzzy <almikes@aol.com>
parents:
diff
changeset
|
11 |
|
1331 | 12 |
== `gearIsInCircle(gear, x, y, r, useRadius)` == |
1329
bd781e19a52d
Split Lua libraries into several sub-pages
Wuzzy <almikes@aol.com>
parents:
diff
changeset
|
13 |
|
1358 | 14 |
Returns whether the gear is inside a circle with x and y being the centre point and r being the radius of the circle. The boolean useRadius determine whether only the centre point of the gear will be used or the radius of the gear will be checked too. |
15 |
||
1394 | 16 |
== `fillMap([flush])` == |
1358 | 17 |
Completely fill the current map with land. Requires `MapGen` to be set to `mgDrawn`. `FlushPoints()` will be called at the end, unless `flush` is set to `false`. |
18 |
||
1394 | 19 |
== `eraseMap([flush])` == |
1651 | 20 |
Completely erase all land from current map. Requires `MapGen` to be set to `mgDrawn`. `FlushPoints()` will be called at the end, unless `flush` is set to `false`. |
21 |
||
22 |
== Standardized land tint colors == |
|
23 |
There are some “standard” tint colors for placed girders and other sprites which are defined to allow more consistency, if it is desired. These values are used in !TechRacer, !HedgeEditor and the basic movement training to colorize girders consistently: |
|
24 |
||
1652 | 25 |
* `U_LAND_TINT_NORMAL`: Normal land |
26 |
* `U_LAND_TINT_ICE`: Icy land |
|
27 |
* `U_LAND_TINT_INDESTRUCTIBLE`: Indestructible land |
|
28 |
* `U_LAND_TINT_BOUNCY`: Bouncy land |