Skip to main content
gamedev.net
🔒 Locked

Fonts && Sprites

Started by David_Jones 1 reply 550+ views
Original Post
David_Jones
David_Jones
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!
Dave Hunt
Dave Hunt
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.
David_Jones
David_Jones
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!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.