Jump to content
  • Advertisement
Sign in to follow this  
cyric74

Quick & Easy HUD Bitmap?

This topic is 5414 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

I'm working on a HUD for my online game client and have come upon a few problems: Basically I have three of four bitmaps that are the static background for my UI controls (mostly borrowed from the DirecX UI sample) which should overlay the 3D rendering of the client scene. I'm looking for a tutorial or simple way to draw these bitmaps under my UI controls, but they also need to be transparent to show the rendered game objects that may be under them. What sort of techniques should I be looking at to do this? Thanks, Cyric

Share this post


Link to post
Share on other sites
Advertisement
1)Draw your game objects

2)Using one of the following, draw your bitmaps with transparency
- D3DXSprite
- TexturedQuad, Transformed(Screen space) coordinate
- TexturedQuad, OrthoProjection (Virtual screen space)

3) Draw your GUI stuff

Share this post


Link to post
Share on other sites
I may be wrong but I think he means depth-ordering?
For this when you draw your sprite you will have to specify increasing Z values (but also keep them very small because if they are inside the 3D view volume your sprites will Z-fight with your meshes).

Another really simple way is to disable depth-buffering after drawing all your meshes, then draw in order:

UI background
UI foreground

But this is ghetto, especially if you are worried about the cost of switching device-states you should go with generating differential depth values as described above.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!