aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClobberXD <ClobberXD@gmail.com>2018-07-31 17:30:02 +0530
committerParamat <paramat@users.noreply.github.com>2018-07-31 13:00:02 +0100
commit654f57333f8784cf2e45a700998cb67d8b4f118e (patch)
tree7c97c0e734dc42c4af392662f560a43acb8d6867
parentbf45644041693f959ac95154b00f15aa27b34145 (diff)
downloadminetest-654f57333f8784cf2e45a700998cb67d8b4f118e.tar.gz
minetest-654f57333f8784cf2e45a700998cb67d8b4f118e.tar.bz2
minetest-654f57333f8784cf2e45a700998cb67d8b4f118e.zip
Lua_api.txt: Improve Player HUD flags documentation (#7588)
-rw-r--r--doc/lua_api.txt31
1 files changed, 17 insertions, 14 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt
index 763393e34..75d96f1c6 100644
--- a/doc/lua_api.txt
+++ b/doc/lua_api.txt
@@ -4774,7 +4774,7 @@ This is basically a reference to a C++ `ServerActiveObject`
* `remove()`: remove object (after returning from Lua)
* Note: Doesn't work on players, use `minetest.kick_player` instead
* `get_pos()`: returns `{x=num, y=num, z=num}`
-* `set_pos(pos)`; `pos`=`{x=num, y=num, z=num}`
+* `set_pos(pos)`: `pos`=`{x=num, y=num, z=num}`
* `move_to(pos, continuous=false)`: interpolated move
* `punch(puncher, time_from_last_punch, tool_capabilities, direction)`
* `puncher` = another `ObjectRef`,
@@ -4938,18 +4938,21 @@ This is basically a reference to a C++ `ServerActiveObject`
* element `stat` values:
`position`, `name`, `scale`, `text`, `number`, `item`, `dir`
* `hud_get(id)`: gets the HUD element definition structure of the specified ID
-* `hud_set_flags(flags)`: sets specified HUD flags to `true`/`false`
- * `flags`: (is visible) `hotbar`, `healthbar`, `crosshair`, `wielditem`,
- `breathbar`, `minimap`, `minimap_radar`
- * pass a table containing a `true`/`false` value of each flag to be set or
- unset.
- * if a flag equals `nil`, the flag is not modified
- * note that setting `minimap` modifies the client's permission to view the
- minimap - the client may locally elect to not view the minimap.
- * minimap `radar` is only usable when `minimap` is true
-* `hud_get_flags()`: returns a table containing status of hud flags
- * returns `{hotbar=true, healthbar=true, crosshair=true, wielditem=true,
- breathbar=true, minimap=true, minimap_radar=true}`
+* `hud_set_flags(flags)`: sets specified HUD flags of player.
+ * `flags`: A table with the following fields set to boolean values
+ * hotbar
+ * healthbar
+ * crosshair
+ * wielditem
+ * breathbar
+ * minimap
+ * minimap_radar
+ * If a flag equals `nil`, the flag is not modified
+ * `minimap`: Modifies the client's permission to view the minimap.
+ The client may locally elect to not view the minimap.
+ * `minimap_radar` is only usable when `minimap` is true
+* `hud_get_flags()`: returns a table of player HUD flags with boolean values.
+ * See `hud_set_flags` for a list of flags that can be toggled.
* `hud_set_hotbar_itemcount(count)`: sets number of items in builtin hotbar
* `count`: number of items, must be between `1` and `23`
* `hud_get_hotbar_itemcount`: returns number of visible items
@@ -6183,7 +6186,7 @@ Used by `minetest.create_detached_inventory`.
HUD Definition
--------------
-Used by `minetest.hud_add`. Returned by `minetest.hud_get`.
+Used by `Player:hud_add`. Returned by `Player:hud_get`.
{
hud_elem_type = "image", -- see HUD element types