Jump to content
  • Advertisement
Sign in to follow this  
oliver_mpt

ID3DXFont and Z buffer

This topic is 3063 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, I have trouble displaying ID3DXFont objects at different depths. I want that my text can be masked by other object. Can I change the Z position of a ID3DXFont sprite ? Oliver

Share this post


Link to post
Share on other sites
Advertisement
Yes, with some work.

One way is to pass D3DXSPRITE_OBJECTSPACE as part of the flags in ID3DXSprite::Begin to put the sprite object's quads through your transformation pipeline. This means you'd have to take care of the labor of positioning the quads.

Even without that flag, ID3DXFont's output can be transformed by the matrix set in ID3DXSprite::SetTransform. (If you use a sprite object, that is.) You can use a scaling matrix for a cheap zoom effect. This is the easiest way to do it.

Alternatively, you can use D3DXCreateText() to generate a mesh of an arbitrary string. That way the text must go through the transformation pipeline as an ID3DXMesh.

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!