Creating a HUD...

Started by
2 comments, last by Sagito 17 years, 9 months ago
Hi all, This might really be a simple question, but I have no idea how to draw a HUD in my games. What do you use, how do you do it (using C++)? I thought about some ways to do it. First one is by using some GDI functions and drawing bitmaps above the DirectX layer. But then, my HUD wouldn't be dynamic, as it might need to be updated every frame or so. The second way is to draw a quad with DirectX and stick it in front of the camera. So, isn't this going to create trouble when I spin the camera? Again, how do I update it? Lol, too many questions here, can anyone help, please? =\ Thanks...
http://sagito.wordpress.com
Advertisement
I asked exactly the same thing yesterday and got a lot of useful replies. You may want to read this thread to get some ideas.

Basically, I ended up drawing a sprite in front of the camera which worked quite good. I'm now looking into colored quads for a GUI and I think that as long as you put those quads on the projection plane there should be no problem keeping them both on top and independent of camera movement.

I've still got to test this though, so don't take my word for it :P
You should put your sprites in screen space. If you use ID3DXSprite, and I believe you do, it does that by default. So, all you have to do is load texture and call ID3DXSprite::Draw() with screen coordinates and texure you want to place on screen.
Bulma
Hmm... I will try that, thanks a lot for both replies... :D

Quote:
So, all you have to do is load texture and call ID3DXSprite::Draw() with screen coordinates and texure you want to place on screen.


But is it only this? It's really simple afterall...

Lol, thanks again...
http://sagito.wordpress.com

This topic is closed to new replies.

Advertisement