LuaLibraryUtils.wiki
author Wuzzy
Wed, 02 May 2018 23:15:10 +0100
changeset 1359 d886660be4d0
parent 1358 a09a11ea67b4
child 1373 2eedf1c53951
permissions -rw-r--r--
LuaLibraryUtils: eraseMap fix
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1329
bd781e19a52d Split Lua libraries into several sub-pages
Wuzzy <almikes@aol.com>
parents:
diff changeset
     1
#summary Lua library documentation: Utils
1345
673321313201 LuaLibraryUtils: labels
Wuzzy
parents: 1336
diff changeset
     2
#labels !LuaLibrary
1331
fef74f26cab9 LuaLibraryUtils: headings
Wuzzy
parents: 1329
diff changeset
     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
fef74f26cab9 LuaLibraryUtils: headings
Wuzzy
parents: 1329
diff changeset
     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
fef74f26cab9 LuaLibraryUtils: headings
Wuzzy
parents: 1329
diff changeset
    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
a09a11ea67b4 LuaLibraryUtils: add fillMap and eraseMap
Wuzzy
parents: 1345
diff changeset
    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.
a09a11ea67b4 LuaLibraryUtils: add fillMap and eraseMap
Wuzzy
parents: 1345
diff changeset
    15
a09a11ea67b4 LuaLibraryUtils: add fillMap and eraseMap
Wuzzy
parents: 1345
diff changeset
    16
== `fillMap(flush)` ==
a09a11ea67b4 LuaLibraryUtils: add fillMap and eraseMap
Wuzzy
parents: 1345
diff changeset
    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`.
a09a11ea67b4 LuaLibraryUtils: add fillMap and eraseMap
Wuzzy
parents: 1345
diff changeset
    18
a09a11ea67b4 LuaLibraryUtils: add fillMap and eraseMap
Wuzzy
parents: 1345
diff changeset
    19
== `eraseMap(flush)` ==
1359
d886660be4d0 LuaLibraryUtils: eraseMap fix
Wuzzy
parents: 1358
diff changeset
    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`.