forked from mtcontrib/minetest_hudbars
Add simple background image for the bars
This commit is contained in:
parent
5f3d4b70c6
commit
2e40e311a0
16
init.lua
16
init.lua
@ -51,6 +51,14 @@ local function custom_hud(player)
|
|||||||
|
|
||||||
if minetest.setting_getbool("enable_damage") then
|
if minetest.setting_getbool("enable_damage") then
|
||||||
--health
|
--health
|
||||||
|
player:hud_add({
|
||||||
|
hud_elem_type = "image",
|
||||||
|
position = HUD_HEALTH_POS,
|
||||||
|
scale = { x = 1, y = 1 },
|
||||||
|
text = "hudbars_bar_background.png",
|
||||||
|
alignment = {x=1,y=1},
|
||||||
|
offset = { x = HUD_HEALTH_OFFSET.x - 1, y = HUD_HEALTH_OFFSET.y - 1 },
|
||||||
|
})
|
||||||
health_hud[name] = player:hud_add({
|
health_hud[name] = player:hud_add({
|
||||||
hud_elem_type = "statbar",
|
hud_elem_type = "statbar",
|
||||||
position = HUD_HEALTH_POS,
|
position = HUD_HEALTH_POS,
|
||||||
@ -61,6 +69,14 @@ local function custom_hud(player)
|
|||||||
})
|
})
|
||||||
|
|
||||||
--air
|
--air
|
||||||
|
player:hud_add({
|
||||||
|
hud_elem_type = "image",
|
||||||
|
position = HUD_AIR_POS,
|
||||||
|
scale = { x = 1, y = 1 },
|
||||||
|
text = "hudbars_bar_background.png",
|
||||||
|
alignment = {x=1,y=1},
|
||||||
|
offset = { x = HUD_AIR_OFFSET.x - 1, y = HUD_AIR_OFFSET.y - 1 },
|
||||||
|
})
|
||||||
air_hud[name] = player:hud_add({
|
air_hud[name] = player:hud_add({
|
||||||
hud_elem_type = "statbar",
|
hud_elem_type = "statbar",
|
||||||
position = HUD_AIR_POS,
|
position = HUD_AIR_POS,
|
||||||
|
BIN
textures/hudbars_bar_background.png
Normal file
BIN
textures/hudbars_bar_background.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 140 B |
Loading…
Reference in New Issue
Block a user