Jump to content
  • Advertisement
Sign in to follow this  
metalmidget

multiple DrawText calls with ID3DXFont

This topic is 3909 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 using ID3DXFont to draw some text on the screen. If I want to draw some big text in the middle of the screen, and some smaller text in the bottom left of the screen, do I need to use separate ID3DXFont objects to get the different sizes? I'm fine with using the different flags to align the text in different places etc, but going through the whole process of creating another D3DXFONT_DESC struct and creating another ID3DFont object with it, is the only method I can think of for getting different sized text. Is there an easier way? cheers, metal

Share this post


Link to post
Share on other sites
Advertisement
Maybe. When you create an ID3DXFont, it loads in the actual font and pre-renders them to textures, for fast blitting. This is why you can't change fonts without creating a new ID3DXFont. Different sized text might be possible with some playing about with renderstates, but even then it would screw with where ID3DXFont placed the characters.

Your best bet would just be to create a new ID3DXFont.

Share this post


Link to post
Share on other sites
Ah ok. I didn't realise how much preliminary stuff it did. I'll just create different objects then. I'll have to try to use the same font formats for as many different things as I can though, or I'll end up with heaps of ID3DXfont's.

cheers,
metal

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!