Skip to content

Commit 70a90bc

Browse files
committedJan 15, 2018
Lua_api.txt: Various improvements
Improve documentation for formspec 'position' and 'anchor' elements. Add missing documentation of 'animation' and 'glow' for particle spawners.
1 parent 1424741 commit 70a90bc

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed
 

‎doc/lua_api.txt

+19-6
Original file line numberDiff line numberDiff line change
@@ -1897,14 +1897,23 @@ examples.
18971897
* deprecated: `invsize[<W>,<H>;]`
18981898

18991899
#### `position[<X>,<Y>]`
1900-
* Define the position of the formspec
1901-
* A value between 0.0 and 1.0 represents a position inside the screen
1902-
* The default value is the center of the screen (0.5, 0.5)
1900+
* Must be used after `size` element.
1901+
* Defines the position on the game window of the formspec's `anchor` point.
1902+
* For X and Y, 0.0 and 1.0 represent opposite edges of the game window, for example:
1903+
* [0.0, 0.0] sets the position to the top left corner of the game window.
1904+
* [1.0, 1.0] sets the position to the bottom right of the game window.
1905+
* Defaults to the center of the game window [0.5, 0.5].
19031906

19041907
#### `anchor[<X>,<Y>]`
1905-
* Define the anchor of the formspec
1906-
* A value between 0.0 and 1.0 represents an anchor inside the formspec
1907-
* The default value is the center of the formspec (0.5, 0.5)
1908+
* Must be used after both `size` and `position` (if present) elements.
1909+
* Defines the location of the anchor point within the formspec.
1910+
* For X and Y, 0.0 and 1.0 represent opposite edges of the formspec, for example:
1911+
* [0.0, 1.0] sets the anchor to the bottom left corner of the formspec.
1912+
* [1.0, 0.0] sets the anchor to the top right of the formspec.
1913+
* Defaults to the center of the formspec [0.5, 0.5].
1914+
1915+
* `position` and `anchor` elements need suitable values to avoid a formspec
1916+
extending off the game window due to particular game window sizes.
19081917

19091918
#### `container[<X>,<Y>]`
19101919
* Start of a container block, moves all physical elements in the container by (X, Y)
@@ -5277,6 +5286,10 @@ Note that in params, use of symbols is as follows:
52775286
-- ^ Uses texture (string)
52785287
playername = "singleplayer"
52795288
-- ^ Playername is optional, if specified spawns particle only on the player's client
5289+
animation = {Tile Animation definition},
5290+
-- ^ optional, specifies how to animate the particle texture
5291+
glow = 0
5292+
-- ^ optional, specify particle self-luminescence in darkness
52805293
}
52815294

52825295
### `HTTPRequest` definition (`HTTPApiTable.fetch_async`, `HTTPApiTable.fetch_async`)

0 commit comments

Comments
 (0)
Please sign in to comment.