Page 1 of 1

Creating custom HUD items

Posted: April 11th, 2011, 2:29 pm
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.

Re: Creating custom HUD items

Posted: April 11th, 2011, 3:25 pm
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.

Re: Creating custom HUD items

Posted: April 12th, 2011, 11:04 am
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.

Re: Creating custom HUD items

Posted: April 12th, 2011, 3:49 pm
by arcones
Exactly. An HUD isn't a menu and is therefore coded differently.

Re: Creating custom HUD items

Posted: April 12th, 2011, 7:57 pm
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?

Re: Creating custom HUD items

Posted: April 13th, 2011, 3:14 am
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.

Re: Creating custom HUD items

Posted: April 14th, 2011, 6:00 am
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.

Re: Creating custom HUD items

Posted: April 14th, 2011, 9:27 am
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?

Re: Creating custom HUD items

Posted: April 14th, 2011, 12:09 pm
by Leo_V117
Probably not. But I have been wrong before.