Jump to content
  • Advertisement
Sign in to follow this  
Sagito

Creating a HUD...

This topic is 4319 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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...

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!