multiple DrawText calls with ID3DXFont

Started by
1 comment, last by metalmidget 16 years, 3 months ago
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
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.
NextWar: The Quest for Earth available now for Windows Phone 7.
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

This topic is closed to new replies.

Advertisement