Use absolute element positioning

This commit is contained in:
tacotexmex 2023-08-06 17:48:19 +02:00
parent 6652b08cb6
commit e43078030a

View File

@ -19,7 +19,7 @@ minetest.register_on_joinplayer(function(player)
name = "wat:text", name = "wat:text",
position = { position = {
x = 0, x = 0,
y = 0.17, y = 0,
}, },
hud_elem_type = "text", hud_elem_type = "text",
number = 0xFFFFFF, number = 0xFFFFFF,
@ -30,7 +30,7 @@ minetest.register_on_joinplayer(function(player)
style = 0, style = 0,
offset = { offset = {
x = 134, x = 134,
y = 0, y = 374,
}, },
text = "", text = "",
}) })
@ -71,9 +71,8 @@ if pointlib_exists then
if technical_name then if technical_name then
text = text .. "\n" .. node_name text = text .. "\n" .. node_name
end end
text = text .. "\n"
-- Update description HUD -- Update description HUD
player:hud_change(wat[name], "text", text) player:hud_change(wat[name], "text", text .. "\n")
end end
-- Reset timer -- Reset timer
timer = 0 timer = 0
@ -113,9 +112,8 @@ else
if technical_name then if technical_name then
text = text .. "\n" .. node_name text = text .. "\n" .. node_name
end end
text = text .. "\n"
-- Draw the description in the HUD item -- 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 -- Reset the HUD timer to display its full cycle
wathudtimer[name] = 0 wathudtimer[name] = 0
end) end)