Skip to content

Commit

Permalink
Lua_api.txt: Improve Player HUD flags documentation (#7588)
Browse files Browse the repository at this point in the history
  • Loading branch information
ClobberXD authored and paramat committed Jul 31, 2018
1 parent bf45644 commit 654f573
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions doc/lua_api.txt
Expand Up @@ -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`,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 654f573

Please sign in to comment.