summaryrefslogtreecommitdiff
path: root/doc/lua_api.txt
diff options
context:
space:
mode:
authorEvidenceB <49488517+EvidenceBKidscode@users.noreply.github.com>2020-08-29 20:13:30 +0200
committerGitHub <noreply@github.com>2020-08-29 20:13:30 +0200
commit5c4b560b6812bbdf7a9d3202c95bad5c9df97d66 (patch)
tree9e29fa859e14890e78cd215b25a0b822a0b37e8b /doc/lua_api.txt
parent386d5f778a299cc0d891eb476674f3eddb108376 (diff)
downloadminetest-5c4b560b6812bbdf7a9d3202c95bad5c9df97d66.tar.gz
minetest-5c4b560b6812bbdf7a9d3202c95bad5c9df97d66.tar.bz2
minetest-5c4b560b6812bbdf7a9d3202c95bad5c9df97d66.zip
Add compass HUD element (#9312)
Co-authored-by: Jean-Patrick Guerrero <jeanpatrick.guerrero@gmail.com> Co-authored-by: Pierre-Yves Rollo <dev@pyrollo.com> Co-authored-by: SmallJoker <SmallJoker@users.noreply.github.com>
Diffstat (limited to 'doc/lua_api.txt')
-rw-r--r--doc/lua_api.txt18
1 files changed, 17 insertions, 1 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt
index 08bdba03e..c81824163 100644
--- a/doc/lua_api.txt
+++ b/doc/lua_api.txt
@@ -1451,7 +1451,23 @@ Same as `image`, but does not accept a `position`; the position is instead deter
* `world_pos`: World position of the waypoint.
* `offset`: offset in pixels from position.
+### `compass`
+Displays an image oriented or translated according to current heading direction.
+
+* `size`: The size of this element. Negative values represent percentage
+ of the screen; e.g. `x=-100` means 100% (width).
+* `scale`: Scale of the translated image (used only for dir = 2 or dir = 3).
+* `text`: The name of the texture to use.
+* `alignment`: The alignment of the image.
+* `offset`: Offset in pixels from position.
+* `dir`: How the image is rotated/translated:
+ * 0 - Rotate as heading direction
+ * 1 - Rotate in reverse direction
+ * 2 - Translate as landscape direction
+ * 3 - Translate in reverse direction
+
+If translation is chosen, texture is repeated horizontally to fill the whole element.
Representations of simple things
================================
@@ -7968,7 +7984,7 @@ Used by `Player:hud_add`. Returned by `Player:hud_get`.
{
hud_elem_type = "image", -- See HUD element types
- -- Type of element, can be "image", "text", "statbar", or "inventory"
+ -- Type of element, can be "image", "text", "statbar", "inventory" or "compass"
position = {x=0.5, y=0.5},
-- Left corner position of element