Original Post
🔒 Locked
DrawText Z Ordering?
Advertisement
Considering that ID3DXFont::DrawText() only takes a RECT input for position, I don't think that it's possible. You could sort the text before you render it, though. This way, lower-layered text gets drawn first, then gets overlayed by higher-layered text.
If you wrap you DrawText in a Sprite's Begin/End block and pass the sprite as the first param to DrawText changes to the sprite object will effect your text. There are a number of things you can do and it will probably take some playing with but setting the transform to a translation on the Z and using the SortDepthBackToFront and AlphaBlend flags ought to work.
hope this helps.
hope this helps.
Quote:
Original post by PersonGuy
That's useful, but not exactly what I'm looking for. I need the text to more than just sort amongst itself. It needs to write and test Z values so that one menu with text could overlap another menu with text. Thanks for the idea though. Any other thoughts?
You're just going to have to draw them in the order you want them yourself. Even if you write your own text class that does do z-buffering, your alpha blending is still going to be order dependent.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement