aboutsummaryrefslogtreecommitdiff
path: root/doc/lua_api.txt
diff options
context:
space:
mode:
Diffstat (limited to 'doc/lua_api.txt')
-rw-r--r--doc/lua_api.txt34
1 files changed, 30 insertions, 4 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt
index b6168c34c..92da534f2 100644
--- a/doc/lua_api.txt
+++ b/doc/lua_api.txt
@@ -672,8 +672,9 @@ Examples:
Elements:
-invsize[<W>,<H>;]
+size[<W>,<H>]
^ Define the size of the menu in inventory slots
+^ deprecated: invsize[<W>,<H>;]
list[<inventory location>;<list name>;<X>,<Y>;<W>,<H>;]
^ Show an inventory list
@@ -684,14 +685,39 @@ image[<X>,<Y>;<W>,<H>;<texture name>]
field[<X>,<Y>;<W>,<H>;<name>;<label>;<default>]
^ Textual field; will be sent to server when a button is clicked
+^ x and y position the field relative to the top left of the menu
+^ w and h are the size of the field
+^ fields are a set height, but will be vertically centred on h
+^ Position and size units are inventory slots
+^ name is the name of the field as returned in fields to on_receive_fields
+^ label, if not blank, will be text printed on the top left above the field
+^ default is the default value of the field
+ ^ default may contain variable references such as '${text}' which
+ will fill the value from the metadata value 'text'
+ ^ Note: no extra text or more than a single variable is supported ATM.
+
+field[<name>;<label>;<default>]
+^ as above but without position/size units
+^ special field for creating simple forms, such as sign text input
+^ must be used without a size[] element
+^ a 'Proceed' button will be added automatically
+
+label[<X>,<Y>;<label>]
+^ x and y work as per field
+^ label is the text on the label
^ Position and size units are inventory slots
-^ Not implemented
button[<X>,<Y>;<W>,<H>;<name>;<label>]
^ Clickable button. When clicked, fields will be sent.
-^ Button will be visible as a field, with the value "active".
+^ x, y and name work as per field
+^ w and h are the size of the button
+^ label is the text on the button
+^ Position and size units are inventory slots
+
+image_button[<X>,<Y>;<W>,<H>;<texture name>;<name>;<label>]
+^ x, y, w, h, and name work as per button
+^ image is the filename of an image
^ Position and size units are inventory slots
-^ Not implemented
Inventory location:
- "context": Selected node metadata (deprecated: "current_name")