add doc/*/scripting/builtins/libgfx-blockwraps.md

This commit is contained in:
MihailRis 2024-11-28 18:28:42 +03:00
parent 14650562c2
commit a5609f3e0c
4 changed files with 47 additions and 0 deletions

View File

@ -15,6 +15,7 @@ Subsections:
- [cameras](scripting/builtins/libcameras.md)
- [entities](scripting/builtins/libentities.md)
- [file](scripting/builtins/libfile.md)
- [gfx.blockwraps](scripting/builtins/libgfx-blockwraps.md)
- [gfx.particles](particles.md#gfxparticles-library)
- [gfx.text3d](3d-text.md#gfxtext3d-library)
- [gui](scripting/builtins/libgui.md)

View File

@ -0,0 +1,22 @@
# Library *gfx.blockwraps*
Library for working with *block wrappers*.
Block wrappers are introduced to implement block destruction animation and can be used for other purposes.
```lua
-- Creates a wrapper at the specified position, with the specified texture.
-- Returns the wrapper id.
gfx.blockwraps.wrap(position: vec3, texture: str) --> int
-- Removes the wrapper, if it exists.
gfx.blockwraps.unwrap(id: int)
-- Changes the position of the wrapper, if it exists.
gfx.blockwraps.set_pos(id: int, position: vec3)
-- Changes the texture of the wrapper, if it exists.
gfx.blockwraps.set_texture(id: int, texture: str)
```
Wrappers are not automatically removed without calling `unwrap`.

View File

@ -15,6 +15,7 @@
- [cameras](scripting/builtins/libcameras.md)
- [entities](scripting/builtins/libentities.md)
- [file](scripting/builtins/libfile.md)
- [gfx.blockwraps](scripting/builtins/libgfx-blockwraps.md)
- [gfx.particles](particles.md#библиотека-gfxparticles)
- [gfx.text3d](3d-text.md#библиотека-gfxtext3d)
- [gui](scripting/builtins/libgui.md)

View File

@ -0,0 +1,23 @@
# Библиотека *gfx.blockwraps*
Библиотека для работы с *обертками блоков*.
Обёртки блоков введены для реализации анимации разрушения блоков и могут
использоваться для иных задач.
```lua
-- Создаёт обертку на указанной позиции, с указанной текстурой.
-- Возвращает id обёртки.
gfx.blockwraps.wrap(position: vec3, texture: str) --> int
-- Удаляет обертку, если она существует.
gfx.blockwraps.unwrap(id: int)
-- Меняет позицию обёртки, если она существует.
gfx.blockwraps.set_pos(id: int, position: vec3)
-- Меняет текстуру обёртки, если она существует.
gfx.blockwraps.set_texture(id: int, texture: str)
```
Обертки не удаляются автоматически без вызова `unwrap`.