GoldenEye: Source Forums

Global Communications => Development Media => killermonkey's Blog => Topic started by: Anthony on March 06, 2008, 06:06:13 am

Title: March 05, 2008 - HUD Elements
Post by: Anthony on March 06, 2008, 06:06:13 am
Hey guys,
You aren't going to believe it. Today, I actually programmed some code. Since HUD has been neglected in previous releases, I took some time to give it a head start. What exactly is HUD? Its all the fun stuff that you see while you play, such as the health bars, crosshairs, and the list goes on. Valve DOES indeed have a good HUD system, but they don't well document it and it requires some exploration before any coder can use it. Since Killer Monkey and I know our way around it, we figured the best way to utilize it would be create a base class for GE based HUD instead of just using Valve's factory code. So in order to create a new HUD element for GES, all we have to do is this:
Code: [Select]
class CGEHudTest : public CGEHudElement
{
    ...
    DECLARE_CLASS( CGEHudTest, CGEHudElement );
    ...
}
...
DECLARE_HUDELEMENT( CGEHudTest );

This is much simpler than what you normally have to do. Since CGEHudElement does all the harder work, just simply treating it as a parent makes CGEHudTest use all the in depth definitions without the extra work.

With this, we were able to start firing away at the HUD. Since the base class was a majority of todays work, I only got a single element implemented, but it worked like a charm. The crosshair is in-game and it works well :)

PS: I was fiddling around, health bar and armor bar are actually ready for implementation.
Your coder,
Anthony Iacono
Title: Re: March 05, 2008 - HUD Elements
Post by: CCsaint10 on March 06, 2008, 06:44:36 am
Nice blog man! I love the fact that you got the crosshair going. That was something that needed some work in the last goldeneye version. Just make sure it pans when you move it too far over to either side or up and down..instead of just being stuck in the center like the last release. :) You're awesome man. Thank you for being an awesome programmer.

CCsaint10
Title: Re: March 05, 2008 - HUD Elements
Post by: VC on March 06, 2008, 09:05:05 am
You have my formula for properly filling the heath bars, correct? Yes.  Yes you do.

btw if you didn't catch the email yet, I think I found a CD mirror of Express 2005 in my pile 'o crap, so I should be covered.
Title: Re: March 05, 2008 - HUD Elements
Post by: Mark [lodle] on March 09, 2008, 08:47:41 am
Not very nice deleting my post because i disagreed with you.
Title: Re: March 05, 2008 - HUD Elements
Post by: Konrad Beerbaum on March 09, 2008, 09:25:33 am
I moved the whole thread to the programmers section of the dev board so that we could discuss it further.
Title: Re: March 05, 2008 - HUD Elements
Post by: Mark [lodle] on March 09, 2008, 09:38:58 am
oh. :P
Title: Re: March 05, 2008 - HUD Elements
Post by: Loafie, Hero of Dreams on March 09, 2008, 10:34:00 am
the feeling was that your way was done correctly so its up for discussion :)