From e43078030aa30b70829eb7e4e8203eea741dce3a Mon Sep 17 00:00:00 2001 From: tacotexmex Date: Sun, 6 Aug 2023 17:48:19 +0200 Subject: [PATCH] Use absolute element positioning --- init.lua | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/init.lua b/init.lua index 08eaf3c..7b342d5 100644 --- a/init.lua +++ b/init.lua @@ -19,7 +19,7 @@ minetest.register_on_joinplayer(function(player) name = "wat:text", position = { x = 0, - y = 0.17, + y = 0, }, hud_elem_type = "text", number = 0xFFFFFF, @@ -30,7 +30,7 @@ minetest.register_on_joinplayer(function(player) style = 0, offset = { x = 134, - y = 0, + y = 374, }, text = "", }) @@ -71,9 +71,8 @@ if pointlib_exists then if technical_name then text = text .. "\n" .. node_name end - text = text .. "\n" -- Update description HUD - player:hud_change(wat[name], "text", text) + player:hud_change(wat[name], "text", text .. "\n") end -- Reset timer timer = 0 @@ -113,9 +112,8 @@ else if technical_name then text = text .. "\n" .. node_name end - text = text .. "\n" -- Draw the description in the HUD item - player:hud_change(wat[name], "text", text) + player:hud_change(wat[name], "text", text .. "\n") -- Reset the HUD timer to display its full cycle wathudtimer[name] = 0 end)