Merge branch 'main' into release-0.26

This commit is contained in:
MihailRis
2025-01-20 04:40:51 +03:00
24 changed files with 416 additions and 36 deletions
+10 -1
View File
@@ -49,10 +49,11 @@ world.is_night() -> bool
world.count_chunks() -> int
-- Returns the compressed chunk data to send.
-- If the chunk is not loaded, returns the saved data.
-- Currently includes:
-- 1. Voxel data (id and state)
-- 2. Voxel metadata (fields)
world.get_chunk_data(x: int, z: int) -> Bytearray
world.get_chunk_data(x: int, z: int) -> Bytearray or nil
-- Modifies the chunk based on the compressed data.
-- Returns true if the chunk exists.
@@ -61,4 +62,12 @@ world.set_chunk_data(
-- compressed chunk data
data: Bytearray
) -> bool
-- Saves chunk data to region.
-- Changes will be written to file only on world save.
world.save_chunk_data(
x: int, z: int,
-- compressed chunk data
data: Bytearray
)
```
+19
View File
@@ -156,6 +156,25 @@ Properties:
| ----- | ------ | ---- | ----- | ------------ |
| src | string | yes | yes | texture name |
## Canvas
Properties:
| Title | Type | Read | Write | Description |
|-------|--------| ---- |-------|-------------|
| data | Canvas | yes | no | canvas data |
Methods:
| Method | Description |
|----------------------------------------------------------|---------------------------------------------------------|
| data:at(x: int, y: int) | returns an RGBA pixel at the given coordinates |
| data:set(x: int, y: int, rgba: int) | updates an RGBA pixel at the given coordinates |
| data:set(x: int, y: int, r: int, g: int, b: int) | updates an RGBA pixel at the given coordinates |
| data:set(x: int, y: int, r: int, g: int, b: int, a: int) | updates an RGBA pixel at the given coordinates |
| data:update() | applies changes to the canvas and uploads it to the GPU |
## Inventory
Properties:
+5 -1
View File
@@ -97,7 +97,11 @@ Inner text is a button text.
- `src` - name of an image stored in textures folder. Extension is not specified. Type: string.
Example: *gui/error*
## *textbox*
## *canvas*
- _No additional attributes_
## *textbox*
Inner text - initially entered text
+10 -1
View File
@@ -48,10 +48,11 @@ world.is_night() -> bool
world.count_chunks() -> int
-- Возвращает сжатые данные чанка для отправки.
-- Если чанк не загружен, возвращает сохранённые данные.
-- На данный момент включает:
-- 1. Данные вокселей (id и состояние)
-- 2. Метаданные (поля) вокселей
world.get_chunk_data(x: int, z: int) -> Bytearray
world.get_chunk_data(x: int, z: int) -> Bytearray или nil
-- Изменяет чанк на основе сжатых данных.
-- Возвращает true если чанк существует.
@@ -60,4 +61,12 @@ world.set_chunk_data(
-- сжатые данные чанка
data: Bytearray
) -> bool
-- Сохраняет данные чанка в регион.
-- Изменения будет записаны в файл только после сохранения мира.
world.save_chunk_data(
x: int, z: int,
-- сжатые данные чанка
data: Bytearray
)
```
+19
View File
@@ -156,6 +156,25 @@ document["worlds-panel"]:clear()
| -------- | ------ | ------ | ------ | --------------------- |
| src | string | да | да | отображаемая текстура |
## Холст (canvas)
Свойства:
| Название | Тип | Чтение | Запись | Описание |
|----------|--------| ------ |--------|----------------|
| data | Canvas | да | нет | пиксели холста |
Методы:
| Метод | Описание |
|----------------------------------------------------------|-----------------------------------------------------|
| data:at(x: int, y: int) | возвращает RGBA пиксель по указанным координатам |
| data:set(x: int, y: int, rgba: int) | изменяет RGBA пиксель по указанным координатам |
| data:set(x: int, y: int, r: int, g: int, b: int) | изменяет RGBA пиксель по указанным координатам |
| data:set(x: int, y: int, r: int, g: int, b: int, a: int) | изменяет RGBA пиксель по указанным координатам |
| data:update() | применяет изменения и загружает холст в видеопамять |
## Inventory (inventory)
Свойства:
+4
View File
@@ -98,6 +98,10 @@
- `src` - имя изображения в папке textures без указания расширения. Тип: строка. Например `gui/error`
## Холст - *canvas*
- _Нет дополнительных свойств_
## Текстовое поле - *textbox*
Внутренний текст - изначально введенный текст