summaryrefslogtreecommitdiff
path: root/doc/client_lua_api.md
diff options
context:
space:
mode:
authorLoïc Blot <nerzhul@users.noreply.github.com>2017-03-16 10:34:54 +0100
committerGitHub <noreply@github.com>2017-03-16 10:34:54 +0100
commit40ce538aad9af8f7634c4ba7e9f12246fb23b31c (patch)
treeda8788a581acbc18bb9f5e35a2be620ba0125471 /doc/client_lua_api.md
parenteb88e5dd4b181a90b382c036cf6c4f42e63e8cc2 (diff)
downloadminetest-40ce538aad9af8f7634c4ba7e9f12246fb23b31c.tar.gz
minetest-40ce538aad9af8f7634c4ba7e9f12246fb23b31c.tar.bz2
minetest-40ce538aad9af8f7634c4ba7e9f12246fb23b31c.zip
[CSM] Add minimap API modifiers (#5399)
* Rename Mapper (too generic) to Minimap * Add lua functions to get/set position, angle, mode for minimap * Client: rename m_mapper to m_minimap * Add minimap to core.ui namespace (core.ui.minimap) * Add various functions to manage minimap (show, hide, toggle_shape) * Cleanup trivial declaration in client
Diffstat (limited to 'doc/client_lua_api.md')
-rw-r--r--doc/client_lua_api.md18
1 files changed, 18 insertions, 0 deletions
diff --git a/doc/client_lua_api.md b/doc/client_lua_api.md
index c07a1c55a..70716ee41 100644
--- a/doc/client_lua_api.md
+++ b/doc/client_lua_api.md
@@ -789,9 +789,27 @@ Call these functions only at load time!
* same as fgettext_ne(), but calls core.formspec_escape before returning result
* `show_formspec(formname, formspec)` : returns true on success
* Shows a formspec to the player
+
+### UI
+* `minetest.ui.minimap`
+ * Reference to the minimap object. See `Minimap` class reference for methods.
+
Class reference
---------------
+### `Minimap`
+An interface to manipulate minimap on client UI
+
+* `show()`: shows the minimap (if not disabled by server)
+* `hide()`: hides the minimap
+* `set_pos(pos)`: sets the minimap position on screen
+* `get_pos()`: returns the minimap current position
+* `set_angle(deg)`: sets the minimap angle in degrees
+* `get_angle()`: returns the current minimap angle in degrees
+* `set_mode(mode)`: sets the minimap mode (0 to 6)
+* `get_mode()`: returns the current minimap mode
+* `toggle_shape()`: toggles minimap shape to round or square.
+
### `Settings`
An interface to read config files in the format of `minetest.conf`.