mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-08 12:31:51 +00:00
update libgfx-blockwraps.md
This commit is contained in:
parent
4d950c974e
commit
c3ab4a160d
2 changed files with 47 additions and 3 deletions
|
|
@ -7,7 +7,14 @@ Block wrappers are introduced to implement block destruction animation and can b
|
||||||
```lua
|
```lua
|
||||||
-- Creates a wrapper at the specified position, with the specified texture.
|
-- Creates a wrapper at the specified position, with the specified texture.
|
||||||
-- Returns the wrapper id.
|
-- Returns the wrapper id.
|
||||||
gfx.blockwraps.wrap(position: vec3, texture: str) --> int
|
gfx.blockwraps.wrap(
|
||||||
|
-- block position
|
||||||
|
position: vec3,
|
||||||
|
-- wrap texture
|
||||||
|
texture: string,
|
||||||
|
-- emission [0.0; 1.0]
|
||||||
|
[optional] emission: number = 1.0
|
||||||
|
) -> int
|
||||||
|
|
||||||
-- Removes the wrapper, if it exists.
|
-- Removes the wrapper, if it exists.
|
||||||
gfx.blockwraps.unwrap(id: int)
|
gfx.blockwraps.unwrap(id: int)
|
||||||
|
|
@ -17,6 +24,21 @@ gfx.blockwraps.set_pos(id: int, position: vec3)
|
||||||
|
|
||||||
-- Changes the texture of the wrapper, if it exists.
|
-- Changes the texture of the wrapper, if it exists.
|
||||||
gfx.blockwraps.set_texture(id: int, texture: str)
|
gfx.blockwraps.set_texture(id: int, texture: str)
|
||||||
|
|
||||||
|
-- Sets the face textures (-X, +X, -Y, +Y, -Z, +Z).
|
||||||
|
-- - nil - disables face rendering.
|
||||||
|
-- - "" - monotone texture.
|
||||||
|
gfx.blockwraps.set_faces(
|
||||||
|
-- wrapper id
|
||||||
|
id: int,
|
||||||
|
-- face texture 1 (-X)
|
||||||
|
face1?: string,
|
||||||
|
-- face texture 2 (+X)
|
||||||
|
face2?: string,
|
||||||
|
...
|
||||||
|
-- face texture 6 (+Z)
|
||||||
|
face6?: string
|
||||||
|
)
|
||||||
```
|
```
|
||||||
|
|
||||||
Wrappers are not automatically removed without calling `unwrap`.
|
Wrappers are not automatically removed without calling `unwrap`.
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,14 @@
|
||||||
```lua
|
```lua
|
||||||
-- Создаёт обертку на указанной позиции, с указанной текстурой.
|
-- Создаёт обертку на указанной позиции, с указанной текстурой.
|
||||||
-- Возвращает id обёртки.
|
-- Возвращает id обёртки.
|
||||||
gfx.blockwraps.wrap(position: vec3, texture: string) -> int
|
gfx.blockwraps.wrap(
|
||||||
|
-- Позиция блока
|
||||||
|
position: vec3,
|
||||||
|
-- Текстура обёртки
|
||||||
|
texture: string,
|
||||||
|
-- Излучение [0.0; 1.0]
|
||||||
|
[опционально] emission: number = 1.0
|
||||||
|
) -> int
|
||||||
|
|
||||||
-- Удаляет обертку, если она существует.
|
-- Удаляет обертку, если она существует.
|
||||||
gfx.blockwraps.unwrap(id: int)
|
gfx.blockwraps.unwrap(id: int)
|
||||||
|
|
@ -18,6 +25,21 @@ gfx.blockwraps.set_pos(id: int, position: vec3)
|
||||||
|
|
||||||
-- Меняет текстуру обёртки, если она существует.
|
-- Меняет текстуру обёртки, если она существует.
|
||||||
gfx.blockwraps.set_texture(id: int, texture: string)
|
gfx.blockwraps.set_texture(id: int, texture: string)
|
||||||
|
|
||||||
|
-- Устанавливает текстуры сторон (-X, +X, -Y, +Y, -Z, +Z).
|
||||||
|
-- - nil - отключает отображение стороны.
|
||||||
|
-- - "" - монотонная текстура.
|
||||||
|
gfx.blockwraps.set_faces(
|
||||||
|
-- id обёртки
|
||||||
|
id: int,
|
||||||
|
-- текстура стороны 1 (-X)
|
||||||
|
face1?: string,
|
||||||
|
-- текстура стороны 2 (+X)
|
||||||
|
face2?: string,
|
||||||
|
...
|
||||||
|
-- текстура стороны 6 (+Z)
|
||||||
|
face6?: string
|
||||||
|
)
|
||||||
```
|
```
|
||||||
|
|
||||||
Обертки не удаляются автоматически без вызова `unwrap`.
|
Обертки не удаляются автоматически без вызова `unwrap`.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue