Fonts && Sprites

Started by
1 comment, last by David_Jones 18 years, 7 months ago
Has anyone managed to get the whole rendering to sprite thing with the ID3DXFont -> DrawText method working? If you specify NULL for the first param it draws straight to the buffer, but you're supposedly meant to be able to specify a sprite in that parameter that it'll render to, which speeds up the rendering process. I've tried handing it a sprite, and using the normal sprite rendering function...get a blank sprite...anyone got some working code for this?
Computers provide a reality second to none!
Advertisement
When you give ID3DXFont a sprite to use for rendering, it renders to the screen using the sprite, it doesn't render to the sprite. You should not follow the DrawText with a sprite render, otherwise you'll just draw over the rendered text.
Thanks so much, that made sense all of a sudden. For others' benefit...create the sprite, then when rendering text, call it as follows...

pSprite -> Begin (D3DXSPRITE_ALPHABLEND);
pFont -> DrawText (pSprite, ....
pSprite -> End ();
Computers provide a reality second to none!

This topic is closed to new replies.

Advertisement