Merge branch 'main' into release-0.26

This commit is contained in:
MihailRis
2025-01-19 20:17:58 +03:00
81 changed files with 950 additions and 269 deletions
+3 -1
View File
@@ -77,12 +77,14 @@ Checks if content is loaded.
```lua
app.new_world(
-- world name
-- world name, empty string will create a nameless world
name: str,
-- generation seed
seed: str,
-- generator name
generator: str
-- local player id
[optional] local_player: int=0
)
```
+3
View File
@@ -62,4 +62,7 @@ hud.is_paused() -> bool
-- Returns true if inventory is open or overlay is shown.
hud.is_inventory_open() -> bool
-- Sets whether to allow pausing. If false, the pause menu will not pause the game.
hud.set_allow_pause(flag: bool)
```
+2 -2
View File
@@ -37,10 +37,10 @@ player.set_vel(playerid: int, x: number, y: number, z: number)
Sets x, y, z player linear velocity
```lua
player.get_rot(playerid: int) -> number, number, number
player.get_rot(playerid: int, interpolated: bool) -> number, number, number
```
Returns x, y, z of camera rotation (radians)
Returns x, y, z of camera rotation (radians). Interpolation is relevant in cases where the rotation refresh rate is lower than the frame rate.
```lua
player.set_rot(playerid: int, x: number, y: number, z: number)
+1
View File
@@ -56,6 +56,7 @@ Common element methods:
| ------------------- | ----------------------------------------------------------------------------------- |
| moveInto(container) | moves the element to the specified container (the element is specified, not the id) |
| destruct() | removes element |
| reposition() | updates the element position based on the `positionfunc` |
## Containers
+31
View File
@@ -19,3 +19,34 @@ Styles can be combined. Example:
Output:
***<ins>Message</ins>*** using *~~combed~~ combined* styles<ins>~~.~~</ins>
# Colors
Text color can be set using a color code: [#RRGGBB]
| Component | Purpose |
| --------- | --------------------------------- |
| R | Represents the intensity of red |
| G | Represents the intensity of green |
| B | Represents the intensity of blue |
### Example:
<span style="color: #ff0000">
<span style="color:rgb(105, 105, 105)">
[#ff0000]
</span>Red Text
</span>
<span style="color: #00ff00">
<span style="color:rgb(105, 105, 105)">
[#00ff00]
</span>Green Text
</span>
<span style="color: #0000ff">
<span style="color:rgb(105, 105, 105)">
[#0000ff]
</span>Blue Text
</span>
+2
View File
@@ -35,6 +35,7 @@ Examples:
- `margin` - element margin. Type: 4D vector
*left, top, right, bottom*
- `visible` - element visibility. Type: boolean (true/false)
- `min-size` - minimal element size. Type: 2D vector.
- `position-func` - position supplier for an element (two numbers), called on every parent container size update or on element adding on a container. May be called before *on_hud_open*
- `size-func` - element size provider (two numbers), called when the size of the container in which the element is located changes, or when an element is added to the container. Can be called before on_hud_open is called.
- `onclick` - lua function called when an element is clicked.
@@ -65,6 +66,7 @@ Buttons and panels are also containers.
Buttons are also panels.
- `max-length` - maximal length of panel stretching before scrolling (if scrollable = true). Type: number
- `min-length` - minimal length of panel. Type: number
- `orientation` - panel orientation: horizontal/vertical.
# Common elements