• Advertisement
Sign in to follow this  

Fonts && Sprites

This topic is 4520 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

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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 ();

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement