Jump to content
  • Advertisement
Sign in to follow this  
jrmiller84

Layering Fonts over Polygons

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

Hey everyone. I've got a quick question. I am working on my 2nd game, an enhanced version of pong with the bricks at the top that you must hit to take out and increase your score. Since my first game was incredibly basic I decided I wanted to add some menus and such to this one to make it more aesthetically pleasing. So I created an image to apply to the right side of the screen to hold the score, lives, etc of the game. This is not a playable area as it will just hold that game information. So to do this I created a rectangle polygon on the right side of the screen and textured it with the texture I created for that area. My problem is that I can not get the text to layer itself on top of that side bar, it goes behind it. I started to think that this had to do with depth buffering so I checked everything and tried messing with the z coordinates of the objects in the game and objects started to disappear if their z value was greater than 0.9f. The instant I set z to 1.0f they would turn black. I'm not sure how to make the font layer itself on to of that polygon. Also, I am using a method that utilized the LPD3DXFONT object to create my text. Any help would be awesome. Thanks guys!

Share this post


Link to post
Share on other sites
Advertisement
It is important to remember that when rendering in 2D what ever you render last is rendered on top. I dont think that the Z-buffer comes in to play in 2D. So just render your text after your panel.

Hope that helps,

ace

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!