Skip to content

Commit

Permalink
add Z-Index (#2)
Browse files Browse the repository at this point in the history
* whitespace indents

* add z_index

* changelog
  • Loading branch information
SwissalpS committed May 17, 2022
1 parent 54afc34 commit b65b647
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@
-- 2018-12-29
-- Physics overrides use player_monoids mod if available


-- Modifications by SwissalpS
-- 2022-05-16
-- Add Z-index to theoretically be behind hotbar and practically behind other HUDs

local HUD_Overlay = true --show glider struts as overlay on HUD
local debug = false --show debug info in top-center of hud
Expand All @@ -61,7 +63,7 @@ end
hangglider = {} --Make this global, so other mods can tell if hangglider exists.
hangglider.use = {}
if HUD_Overlay then
hangglider.id = {} -- hud id for displaying overlay with struts
hangglider.id = {} -- hud id for displaying overlay with struts
end
if debug then hangglider.debug = {} end -- hud id for debug data
--hangglider.airbreak = {} -- true if falling fast when equip
Expand Down Expand Up @@ -296,14 +298,16 @@ minetest.register_on_joinplayer(function(player)
})
hangglider.use[pname] = false
if HUD_Overlay then
hangglider.id[pname] = player:hud_add({
hud_elem_type = "image",
text = "blank.png",
position = {x=0, y=0},
scale = {x=-100, y=-100},
alignment = {x=1, y=1},
offset = {x=0, y=0}
}) end
hangglider.id[pname] = player:hud_add({
hud_elem_type = "image",
text = "blank.png",
position = {x=0, y=0},
scale = {x=-100, y=-100},
alignment = {x=1, y=1},
offset = {x=0, y=0},
z_index = -150
})
end
if debug then
hangglider.debug[pname] = {id = player:hud_add({hud_elem_type = "text",
position = {x=0.5, y=0.1},
Expand Down

0 comments on commit b65b647

Please sign in to comment.