aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Rudin <thomas@rudin.io>2018-12-07 09:48:38 +0100
committerorwell96 <mono96.mml@gmail.com>2018-12-10 17:16:23 +0100
commitedeb3406ef164f37829d231803460d154a73dee9 (patch)
tree2826088d718fc2a374d3bfc60160e386fa3a8298
parent976a79b2079d97671fedbb0882c4f42eec6213c0 (diff)
downloadposhud-edeb3406ef164f37829d231803460d154a73dee9.zip
poshud-edeb3406ef164f37829d231803460d154a73dee9.tar.gz
poshud-edeb3406ef164f37829d231803460d154a73dee9.tar.bz2
take hud offset from settings or use defaults if none found
-rw-r--r--init.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/init.lua b/init.lua
index 50a6bf5..4b2dddc 100644
--- a/init.lua
+++ b/init.lua
@@ -9,6 +9,12 @@
----------------Zeno` simplified some math and additional tweaks ---------------
--------------------------------------------------------------------------------
+poshud = {
+ -- Position of hud
+ posx = tonumber(minetest.settings:get("poshud.hud.offsetx") or 0.8),
+ posy = tonumber(minetest.settings:get("poshud.hud.offsety") or 0.95)
+}
+
--settings
colour = 0xFFFFFF --text colour in hex format default is white
@@ -25,7 +31,7 @@ local function generatehud(player)
hud.id = player:hud_add({
hud_elem_type = "text",
name = "poshud",
- position = {x=0.80, y=0.95},
+ position = {x=poshud.posx, y=poshud.posy},
offset = {x=8, y=-8},
text = "Initializing...",
scale = {x=100,y=100},