Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Heads Up Display?

Author
Message
ReiKumar
16
Years of Service
User Offline
Joined: 23rd Sep 2008
Location:
Posted: 5th Oct 2008 00:28 Edited at: 5th Oct 2008 00:42
I'm just wondering how you guys do HUD's.

Do you just set cursor position and print out text or do you use another method?

Anyone got any advice for me?

Right now I'm trying to using:

Quote: "dbText
This command will output the provided string using the current text settings at the specified coordinates on the screen.

Syntax
void dbText ( int iX, int iY, char* szString ) "
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 5th Oct 2008 00:38
It's simple. Draw something in an image editor, load it, and display the sprites.
AndrewT
17
Years of Service
User Offline
Joined: 11th Feb 2007
Location: MI, USA
Posted: 5th Oct 2008 00:41
First of all you've gotta ditch the 'dbPrint()' function; you should use 'dbText()'. With 'dbText()' you can print text much easier wherever you choose without moving the cursor. You can use 'dbSetTextFont()' and 'dbSetTextSize()' to change the look as well like so:



Now if you to make your HUD more polished you should use sprites for elements for images such as what weapon you're using and what not.

ReiKumar
16
Years of Service
User Offline
Joined: 23rd Sep 2008
Location:
Posted: 5th Oct 2008 00:44
Quote: "First of all you've gotta ditch the 'dbPrint()' function; you should use 'dbText()'. With 'dbText()' you can print text much easier wherever you choose without moving the cursor. You can use 'dbSetTextFont()' and 'dbSetTextSize()' to change the look as well like so:

+ Code Snippet

dbSetTextFont( "verdana" );
dbSetTextSize( 12 );
dbText( "Hello World!", 100, 100 );



Now if you to make your HUD more polished you should use sprites for elements for images such as what weapon you're using and what not."


Hmm... So instead of jus text, I can load up images... I'm guessing you mean images of weapons and equipment the player is holding, correct?
ReiKumar
16
Years of Service
User Offline
Joined: 23rd Sep 2008
Location:
Posted: 5th Oct 2008 01:01
Here's an issue: My game automatically sets the resolution to whatever is avalible on the computer so how do I position text on the right side of the screen when I dont know what the x distance from the left is.
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 5th Oct 2008 01:34
dbScreenWidth();
dbScreenHeight();
SushiBox
16
Years of Service
User Offline
Joined: 20th Sep 2008
Location: Ohio
Posted: 5th Oct 2008 01:38
Text at 0, 0 will be in the same position on 800x600 and the exact same as on 1024x768.

But you can do a check as Zuka suggested. Those will return the resolution that was selected, that way your program will know which resolution the screen is currently set to.

www.Helios-Online.net
ReiKumar
16
Years of Service
User Offline
Joined: 23rd Sep 2008
Location:
Posted: 5th Oct 2008 01:58
Quote: "dbScreenWidth();
dbScreenHeight(); "


Thanks that helps, now I just gotta set it up through trial and error so that it shows up in the screen instead of of the edge. Lol
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 5th Oct 2008 02:00 Edited at: 5th Oct 2008 02:00
text_position_x = dbScreenWidth() - text_length * text_size;
ReiKumar
16
Years of Service
User Offline
Joined: 23rd Sep 2008
Location:
Posted: 5th Oct 2008 02:20
Quote: "text_position_x = dbScreenWidth() - text_length * text_size; "


Or I could do that. Thanx

Login to post a reply

Server time is: 2024-09-30 07:33:39
Your offset time is: 2024-09-30 07:33:39