aboutsummaryrefslogtreecommitdiff
path: root/doc/client_lua_api.txt
diff options
context:
space:
mode:
authorElias Fleckenstein <eliasfleckenstein@web.de>2021-05-11 14:07:30 +0200
committerElias Fleckenstein <eliasfleckenstein@web.de>2021-05-11 14:07:30 +0200
commit4f613bbf5118ebe8c3610514e7f4206e930783bf (patch)
treebcb4bbb7609019f948e31b7749e1beb6b23e634d /doc/client_lua_api.txt
parentc86dcd0f682f76339989afec255bf3d7078db096 (diff)
downloaddragonfireclient-4f613bbf5118ebe8c3610514e7f4206e930783bf.tar.xz
Include tile definitions in get_node_def; Client-side minetest.object_refs table
Diffstat (limited to 'doc/client_lua_api.txt')
-rw-r--r--doc/client_lua_api.txt61
1 files changed, 61 insertions, 0 deletions
diff --git a/doc/client_lua_api.txt b/doc/client_lua_api.txt
index 2e347ec47..e33fe0e3a 100644
--- a/doc/client_lua_api.txt
+++ b/doc/client_lua_api.txt
@@ -934,6 +934,8 @@ Call these functions only at load time!
* Convert between two privilege representations
### Client Environment
+* `minetest.object_refs`
+ * Map of object references, indexed by active object id
* `minetest.get_player_names()`
* Returns list of player names on server (nil if CSM_RF_READ_PLAYERINFO is enabled by server)
* `minetest.get_objects_inside_radius(pos, radius)`: returns a list of
@@ -1454,6 +1456,8 @@ It can be created via `Raycast(pos1, pos2, objects, liquids)` or
-----------------
### Definitions
+* `minetest.inventorycube(img1, img2, img3)`
+ * Returns a string for making an image of a cube (useful as an item image)
* `minetest.get_node_def(nodename)`
* Returns [node definition](#node-definition) table of `nodename`
* `minetest.get_item_def(itemstring)`
@@ -1465,10 +1469,67 @@ It can be created via `Raycast(pos1, pos2, objects, liquids)` or
{light_source=minetest.LIGHT_MAX})`
* Doesnt really work yet an causes strange bugs, I'm working to make is better
+
+#### Tile definition
+
+* `"image.png"`
+* `{name="image.png", animation={Tile Animation definition}}`
+* `{name="image.png", backface_culling=bool, align_style="node"/"world"/"user", scale=int}`
+ * backface culling enabled by default for most nodes
+ * align style determines whether the texture will be rotated with the node
+ or kept aligned with its surroundings. "user" means that client
+ setting will be used, similar to `glasslike_framed_optional`.
+ Note: supported by solid nodes and nodeboxes only.
+ * scale is used to make texture span several (exactly `scale`) nodes,
+ instead of just one, in each direction. Works for world-aligned
+ textures only.
+ Note that as the effect is applied on per-mapblock basis, `16` should
+ be equally divisible by `scale` or you may get wrong results.
+* `{name="image.png", color=ColorSpec}`
+ * the texture's color will be multiplied with this color.
+ * the tile's color overrides the owning node's color in all cases.
+
+##### Tile definition
+
+ {
+ type = "vertical_frames",
+
+ aspect_w = 16,
+ -- Width of a frame in pixels
+
+ aspect_h = 16,
+ -- Height of a frame in pixels
+
+ length = 3.0,
+ -- Full loop length
+ }
+
+ {
+ type = "sheet_2d",
+
+ frames_w = 5,
+ -- Width in number of frames
+
+ frames_h = 3,
+ -- Height in number of frames
+
+ frame_length = 0.5,
+ -- Length of a single frame
+ }
+
#### Node Definition
```lua
{
+ tiles = {tile definition 1, def2, def3, def4, def5, def6},
+ -- Textures of node; +Y, -Y, +X, -X, +Z, -Z
+ overlay_tiles = {tile definition 1, def2, def3, def4, def5, def6},
+ -- Same as `tiles`, but these textures are drawn on top of the base
+ -- tiles. This is used to colorize only specific parts of the
+ -- texture. If the texture name is an empty string, that overlay is not
+ -- drawn
+ special_tiles = {tile definition 1, Tile definition 2},
+ -- Special textures of node; used rarely.
has_on_construct = bool, -- Whether the node has the on_construct callback defined
has_on_destruct = bool, -- Whether the node has the on_destruct callback defined
has_after_destruct = bool, -- Whether the node has the after_destruct callback defined