Page 1 of 1

Replace builtin HUD entirely?

Posted: Tue Jun 02, 2015 03:08
by mrf
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

Re: Replace builtin HUD entirely?

Posted: Tue Jun 02, 2015 06:33
by Wuzzy
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. ;-)

Re: Replace builtin HUD entirely?

Posted: Tue Jun 02, 2015 11:08
by mrf
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

Re: Replace builtin HUD entirely?

Posted: Tue Jun 02, 2015 11:50
by Wuzzy
Sounds interesting. I am looking forward for the first release of your game. :-)

Re: Replace builtin HUD entirely?

Posted: Sat Aug 08, 2015 14:17
by mrf
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.