aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorDiego Martínez <kaeza@users.sf.net>2013-04-22 20:47:59 -0300
committerPerttu Ahola <celeron55@gmail.com>2013-04-23 09:34:11 +0300
commit9894167bbf516c40bf2b8577179ff8f13b8b54e2 (patch)
tree245d10d35d9adbe9883394cfa7b6c4f8a5950486 /doc
parent7c37b1891adcddc0e7d11e5faafddaa554443318 (diff)
downloadminetest-9894167bbf516c40bf2b8577179ff8f13b8b54e2.tar.gz
minetest-9894167bbf516c40bf2b8577179ff8f13b8b54e2.tar.bz2
minetest-9894167bbf516c40bf2b8577179ff8f13b8b54e2.zip
Added offset support for HUD items
Diffstat (limited to 'doc')
-rw-r--r--doc/lua_api.txt8
1 files changed, 8 insertions, 0 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt
index 774448778..76f687f8e 100644
--- a/doc/lua_api.txt
+++ b/doc/lua_api.txt
@@ -412,6 +412,9 @@ The direction field is the direction in which something is drawn.
The alignment field specifies how the item will be aligned. It ranges from -1 to 1,
with 0 being the center, -1 is moved to the left/up, and 1 is to the right/down. Fractional
values can be used.
+The offset field specifies a pixel offset from the position. Contrary to position,
+the offset is not scaled to screen size. This allows for some precisely-positioned
+items in the HUD.
Below are the specific uses for fields in each type; fields not listed for that type are ignored.
Note: Future revisions to the HUD API may be incompatible; the HUD API is still in the experimental stages.
@@ -422,6 +425,7 @@ Note: Future revisions to the HUD API may be incompatible; the HUD API is still
Only the X coordinate scale is used.
- text: The name of the texture that is displayed.
- alignment: The alignment of the image.
+ - offset: offset in pixels from position.
- text
Displays text on the HUD.
- scale: Defines the bounding rectangle of the text.
@@ -430,12 +434,14 @@ Note: Future revisions to the HUD API may be incompatible; the HUD API is still
- number: An integer containing the RGB value of the color used to draw the text.
Specify 0xFFFFFF for white text, 0xFF0000 for red, and so on.
- alignment: The alignment of the text.
+ - offset: offset in pixels from position.
- statbar
Displays a horizontal bar made up of half-images.
- text: The name of the texture that is used.
- number: The number of half-textures that are displayed.
If odd, will end with a vertically center-split texture.
- direction
+ - offset: offset in pixels from position.
- inventory
- text: The name of the inventory list to be displayed.
- number: Number of items in the inventory to be displayed.
@@ -1864,4 +1870,6 @@ HUD Definition (hud_add, hud_get)
^ Direction: 0: left-right, 1: right-left, 2: top-bottom, 3: bottom-top
alignment = {x=0, y=0},
^ See "HUD Element Types"
+ offset = {x=0, y=0},
+ ^ See "HUD Element Types"
}