Displaying GUI elements in game

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
me_go_fast
Posts: 8
Joined: Fri Jul 23, 2004 2:45 am
Location: Untied States

Displaying GUI elements in game

Post by me_go_fast »

does anyone know how to get gui elements to show up on the screen when a map is loaded. For example, when you are in the game the players energy bar or health bar? Please, if you know how i would appreciate all the help i can get.
*thanks*
bal
Posts: 829
Joined: Fri Jun 18, 2004 5:19 pm
Location: Geluwe, Belgium

Post by bal »

I did this but I got some problems with the redrawing. Can't you just delete all the gui elements before draw the "updated" ones ?
General Tools List
General FAQ
System: AMD Barton 2600+, 512MB, 9600XT 256MB, WinXP + FC3
joy
Posts: 124
Joined: Tue Apr 27, 2004 9:15 am
Location: Germany

Post by joy »

It is a matter of the order of drawing. Draw all meshes first and then the GUI-Elements.
bal
Posts: 829
Joined: Fri Jun 18, 2004 5:19 pm
Location: Geluwe, Belgium

Post by bal »

joy wrote:It is a matter of the order of drawing. Draw all meshes first and then the GUI-Elements.
They will be deleted automatically? Because I had performance problems, every second the FPS went down...
General Tools List
General FAQ
System: AMD Barton 2600+, 512MB, 9600XT 256MB, WinXP + FC3
joy
Posts: 124
Joined: Tue Apr 27, 2004 9:15 am
Location: Germany

Post by joy »

Are you sure you have to delete them? I thought that me_go_fast wanted to just put GUIElements in front of the map. Therefore I think you don't have to delete anything , just do take care of the order of drawing. Am I wrong?
Firemorph
Posts: 5
Joined: Mon Jul 19, 2004 2:57 pm
Location: Norway
Contact:

Post by Firemorph »

Would they in that case also be updated by themselves? As me_go_fast wantet life-bars and such, they will have to be updated, and if you don't dele them, I'm afraid you'll just draw them on each other, resulting in bad performance, but I'm not sure though.
bal
Posts: 829
Joined: Fri Jun 18, 2004 5:19 pm
Location: Geluwe, Belgium

Post by bal »

Firemorph wrote:Would they in that case also be updated by themselves? As me_go_fast wantet life-bars and such, they will have to be updated, and if you don't dele them, I'm afraid you'll just draw them on each other, resulting in bad performance, but I'm not sure though.
That's what I encountered...
Now I fixed the healthbar using driver->draw2DRectangle which seems to be working. But I'll need GUI elements that need to be redrawn...
General Tools List
General FAQ
System: AMD Barton 2600+, 512MB, 9600XT 256MB, WinXP + FC3
Firemorph
Posts: 5
Joined: Mon Jul 19, 2004 2:57 pm
Location: Norway
Contact:

Post by Firemorph »

I just added some GUI-elements myself which needs updating all the time, however they don't!
The text is just drawn top of the old, resulting in an unreadable mess.

Anyone got a solution to this?
Post Reply