aboutsummaryrefslogtreecommitdiff
path: root/doc/lua_api.txt
diff options
context:
space:
mode:
authorWuzzy <wuzzy2@mail.ru>2020-05-11 21:40:45 +0200
committerGitHub <noreply@github.com>2020-05-11 21:40:45 +0200
commit6e1372bd894d955300c40d69e5c882e9cc7d7523 (patch)
tree6273a8c2ddfec5efbc5b69fa49b088368dd78c15 /doc/lua_api.txt
parent88bb8e57e6780130df1877e7a89bb56c9561ea6a (diff)
downloadhax-minetest-server-6e1372bd894d955300c40d69e5c882e9cc7d7523.tar.gz
hax-minetest-server-6e1372bd894d955300c40d69e5c882e9cc7d7523.zip
Add support for statbar “off state” icons (#9462)
This adds support for optional “off state” icons for statbars. “off state icons” can be used to denote the lack of something, like missing hearts or bubbles. Add "off state" textures to the builtin statbars. Co-authored-by: SmallJoker <mk939@ymail.com>
Diffstat (limited to '')
-rw-r--r--doc/lua_api.txt16
1 files changed, 11 insertions, 5 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt
index 961e1ff37..4078e21a1 100644
--- a/doc/lua_api.txt
+++ b/doc/lua_api.txt
@@ -1289,9 +1289,9 @@ To account for differing resolutions, the position coordinates are the
percentage of the screen, ranging in value from `0` to `1`.
The name field is not yet used, but should contain a description of what the
-HUD element represents. The direction field is the direction in which something
-is drawn.
+HUD element represents.
+The `direction` field is the direction in which something is drawn.
`0` draws from left to right, `1` draws from right to left, `2` draws from
top to bottom, and `3` draws from bottom to top.
@@ -1355,12 +1355,16 @@ Displays text on the HUD.
### `statbar`
-Displays a horizontal bar made up of half-images.
+Displays a horizontal bar made up of half-images with an optional background.
-* `text`: The name of the texture that is used.
+* `text`: The name of the texture to use.
+* `text2`: Optional texture name to enable a background / "off state"
+ texture (useful to visualize the maximal value). Both textures
+ must have the same size.
* `number`: The number of half-textures that are displayed.
If odd, will end with a vertically center-split texture.
-* `direction`
+* `item`: Same as `number` but for the "off state" texture
+* `direction`: To which direction the images will extend to
* `offset`: offset in pixels from position.
* `size`: If used, will force full-image size to this value (override texture
pack image size)
@@ -7772,6 +7776,8 @@ Used by `Player:hud_add`. Returned by `Player:hud_get`.
text = "<text>",
+ text2 = "<text>",
+
number = 2,
item = 3,