mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-14 07:21:51 +00:00
update doc/en/**
This commit is contained in:
parent
f7462a8bcb
commit
c340eba358
6 changed files with 207 additions and 267 deletions
50
doc/en/scripting/builtins/libhud.md
Normal file
50
doc/en/scripting/builtins/libhud.md
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
# *hud* library
|
||||
|
||||
```lua
|
||||
-- Open player inventory.
|
||||
hud.open_inventory()
|
||||
|
||||
-- Close inventory.
|
||||
hud.close_inventory()
|
||||
|
||||
-- Open block UI and inventory.
|
||||
-- Throws an exception if block has no UI layout.
|
||||
-- Returns block inventory ID (if *"inventory-size"=0* a virtual
|
||||
-- inventory will be created), and UI layout ID.
|
||||
hud.open_block(x: int, y: int, z: int) -> int, str
|
||||
```
|
||||
|
||||
> [!NOTE]
|
||||
> Only one block may be open at same time
|
||||
|
||||
```lua
|
||||
-- Show overlay with layout specified.
|
||||
-- Shows player inventory also if playerinv is true.
|
||||
hud.show_overlay(layoutid: str, playerinv: bool)
|
||||
|
||||
-- Add element to the screen.
|
||||
-- The element will be removed on world close only.
|
||||
-- inventory element will be bound to the player inventory.
|
||||
hud.open_permanent(layoutid: str)
|
||||
|
||||
-- Remove an element from the screen.
|
||||
hud.close(layoutid: str)
|
||||
|
||||
-- Get open block inventory ID or 0.
|
||||
hud.get_block_inventory() -> int
|
||||
|
||||
-- Gives the ID of the player that the UI is bound to.
|
||||
hud.get_player() -> int
|
||||
|
||||
-- Opens the pause menu
|
||||
hud.pause()
|
||||
|
||||
-- Closes the pause menu.
|
||||
hud.resume()
|
||||
|
||||
-- Returns true if pause menu is open.
|
||||
hud.is_paused() -> bool
|
||||
|
||||
-- Returns true if inventory is open or overlay is shown.
|
||||
hud.is_inventory_open() -> bool
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue