mirror of
https://github.com/minetest/minetest.git
synced 2024-08-18 20:44:16 +02:00
Lua_api.txt: Improve Player HUD flags documentation (#7588)
This commit is contained in:
parent
bf45644041
commit
654f57333f
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user