Replace builtin HUD entirely?

User avatar
mrf
Member
 
Posts: 11
Joined: Fri Aug 01, 2014 17:08

Replace builtin HUD entirely?

by mrf » Tue Jun 02, 2015 03:08

Howdy,

The game I'm working on calls for a need to know one's health, breath, and location in the world. However, there is no need to view inventory nor crosshairs. I thought I could easily replace the relevant HUD elements and remove the inventory and crosshairs. After researching this, I now don't think this can be done. Is it possible? If so, (and if it's accomplished with something like player:remove_hud()), what is the best procedure for getting the IDs of the built-in HUD elements?

thx-mrf
 

User avatar
Wuzzy
Member
 
Posts: 3625
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Re: Replace builtin HUD entirely?

by Wuzzy » Tue Jun 02, 2015 06:33

The function you are searching for is hud_set_flags. This function turns the built-in HUD elements on and off.

Code: Select all
player:hud_set_flags({crosshair=false, hotbar=false})

This turns off the built-in crosshair and hotbar.

There are also breathbar, healthbar and wielditem, in case you want to remove these, too.

Why do you want to remove the crosshair, by the way? If you just want to change its looks, you can provide the texture crosshair.png. But if you really want to remove the crosshair, go on. ;-)
 

User avatar
mrf
Member
 
Posts: 11
Joined: Fri Aug 01, 2014 17:08

Re: Replace builtin HUD entirely?

by mrf » Tue Jun 02, 2015 11:08

Hi Wuzzy,

Thanks for the help. I can't believe I missed that--I kept going over and over the functions in the API looking for something I missed. Over and over the wrong functions, that is.

The game is exploration+survival and nothing in the environment is used so inventory and a crosshair is unnecessary. In fact, since most of the gameplay involves searching the landscape for things that might kill you (like those awful vampire things from animals_modpack), the crosshair is in the way.

Mrf
 

User avatar
Wuzzy
Member
 
Posts: 3625
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Re: Replace builtin HUD entirely?

by Wuzzy » Tue Jun 02, 2015 11:50

Sounds interesting. I am looking forward for the first release of your game. :-)
 

User avatar
mrf
Member
 
Posts: 11
Joined: Fri Aug 01, 2014 17:08

Re: Replace builtin HUD entirely?

by mrf » Sat Aug 08, 2015 14:17

Hi,

I finally finished a releasable version of it although I didn't post the custom HUD because I've noticed that the air indicator isn't always accurate, (I may post it anyways). Anyways, I'm not sure if I can post a link here but here goes anyway:

http://www.richfox.org/software/minercise/index.html

(Oh, I guess I can)

Thanks again for your help.
 


Return to Modding Discussion



Who is online

Users browsing this forum: No registered users and 1 guest