Global Communications > killermonkey's Blog
March 05, 2008 - HUD Elements
Anthony:
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: ---
class CGEHudTest : public CGEHudElement
{
...
DECLARE_CLASS( CGEHudTest, CGEHudElement );
...
}
...
DECLARE_HUDELEMENT( CGEHudTest );
--- End code ---
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
CCsaint10:
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
VC:
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.
Mark [lodle]:
Not very nice deleting my post because i disagreed with you.
Konrad Beerbaum:
I moved the whole thread to the programmers section of the dev board so that we could discuss it further.
Navigation
[0] Message Index
[#] Next page
Go to full version