Hi! Welcome to the forum for Platinum Arts Sandbox Free 3D Game Maker. I currently have the forums locked as I am attempting to properly update them.

In the meantime please join the new Discord Server!

If you have any questions please e-mail me through the Platinum Arts website.

Creating custom HUD items

Having issues not related to a specific Sandbox game mode? Get help here!
Please also read the rules for support when posting support requests.
Failure to comply with the forum rules may result in your topic being locked without resolution.
Locked
Talkless
Member
Member
Posts: 7
Joined: April 9th, 2011, 9:07 am

Creating custom HUD items

Post by Talkless »

Hello,

I am interested in adding custom HUD "widgets" onto screen, for example, health bar, "currently used item" or whatever.

showgui, if I got it correctly, shows only modal menus?

How it is possible to show, let's say, custom image in corner of screen?

I've been looking in The Golden Coin (has it's version number "printed") and Master Chef Ogro (life bar) projects but failed at "encoding" them. And I can't find information about it in Wiki or forums.

Thanks.
arcones
Support Team
Support Team
Posts: 2734
Joined: January 13th, 2010, 12:42 pm
Name: Timothy
IRC Username: I use Steam
Location: Looking over your shoulder...
Contact:

Re: Creating custom HUD items

Post by arcones »

Actually showgui is used for ANY menu, while guiimage (or something similar) is used for placing pictures in those menus. Theoretically you could find the folder which contains the health/mana bars and replacing them with your own images.
Image
Want a user bar like this one? PM Leo!
Talkless
Member
Member
Posts: 7
Joined: April 9th, 2011, 9:07 am

Re: Creating custom HUD items

Post by Talkless »

But if I call showgui, it pops in the center of screen. The mouse pointer appears and so I cannot turn my camera any more. And it disappears with Esc key.

It doesn't look like always-on-screen HUD.
arcones
Support Team
Support Team
Posts: 2734
Joined: January 13th, 2010, 12:42 pm
Name: Timothy
IRC Username: I use Steam
Location: Looking over your shoulder...
Contact:

Re: Creating custom HUD items

Post by arcones »

Exactly. An HUD isn't a menu and is therefore coded differently.
Image
Want a user bar like this one? PM Leo!
chocolatepie33
Support Team
Support Team
Posts: 2458
Joined: April 27th, 2010, 5:31 pm
IRC Username: CP

Re: Creating custom HUD items

Post by chocolatepie33 »

showgui pulls up a menu/window. Like said, a HUD is more RPG stuff. Are you looking for a text HUD kind of thing? Like something that constantly updates with data, and is always there?
Julius wrote:Contribute to http://www.opengameart.org NOW!
Save the wiki!
Talkless
Member
Member
Posts: 7
Joined: April 9th, 2011, 9:07 am

Re: Creating custom HUD items

Post by Talkless »

arcones wrote:Exactly. An HUD isn't a menu and is therefore coded differently.
So... how that "differently" looks like?

I am interested in displaying text and/or images on screen, with possibility to change them during gameplay.
User avatar
Leo_V117
Support Team
Support Team
Posts: 1640
Joined: February 16th, 2010, 8:00 pm
Name: Leo
IRC Username: Leo_V117
Location: That one place...
Contact:

Re: Creating custom HUD items

Post by Leo_V117 »

The HUD (or Heads Up Display) Is "called" through a Header (*.h) or a CPP (*.cpp) File, using any GUI functions would do nothing. GUI stands for "Graphical User Interface" and it has no relation whatsoever to the HUD as GUI is for menu specific items only. My advice would be to take a look at "rpghud.cpp" in "src/rpggame" and creating a new HUD for whichever mode youre wanting to use, using the "rpghud.cpp" as a guide to assist you in the development of the new HUD. Ensure you have codeblocks installed.
Talkless
Member
Member
Posts: 7
Joined: April 9th, 2011, 9:07 am

Re: Creating custom HUD items

Post by Talkless »

Leo_V117 wrote: My advice would be to take a look at "rpghud.cpp".
Oh, so it's not possible to do that in Cubescript alone.

Is it planned for the future?
User avatar
Leo_V117
Support Team
Support Team
Posts: 1640
Joined: February 16th, 2010, 8:00 pm
Name: Leo
IRC Username: Leo_V117
Location: That one place...
Contact:

Re: Creating custom HUD items

Post by Leo_V117 »

Probably not. But I have been wrong before.
Locked