summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlisacvuk <lisacvukhome@gmail.com>2018-02-04 10:17:46 +0100
committerLoïc Blot <nerzhul@users.noreply.github.com>2018-02-04 10:17:46 +0100
commit4f5090ff68a0c51fd7bf23a709c27721109d8c5e (patch)
treeaddd29761d8dc531d5f5bb3e33740893dec04981
parent735fc2a1f25eed78460c02867a4960fbf1e66a72 (diff)
downloadminetest-4f5090ff68a0c51fd7bf23a709c27721109d8c5e.tar.gz
minetest-4f5090ff68a0c51fd7bf23a709c27721109d8c5e.tar.bz2
minetest-4f5090ff68a0c51fd7bf23a709c27721109d8c5e.zip
Make hud_get return aligment, offset and size. (#7006)
* Make hud_get return aligment and offset. * Return size aswell.
-rw-r--r--src/script/common/c_content.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/script/common/c_content.cpp b/src/script/common/c_content.cpp
index cac48d488..38e9411af 100644
--- a/src/script/common/c_content.cpp
+++ b/src/script/common/c_content.cpp
@@ -1865,6 +1865,15 @@ void push_hud_element(lua_State *L, HudElement *elem)
lua_pushnumber(L, elem->dir);
lua_setfield(L, -2, "direction");
+ push_v2f(L, elem->offset);
+ lua_setfield(L, -2, "offset");
+
+ push_v2f(L, elem->align);
+ lua_setfield(L, -2, "alignment");
+
+ push_v2s32(L, elem->size);
+ lua_setfield(L, -2, "size");
+
// Deprecated, only for compatibility's sake
lua_pushnumber(L, elem->dir);
lua_setfield(L, -2, "dir");