Sign in to follow this  
Sambori

Rotating Text

Recommended Posts

Hello,

How can i obtain the font sprite's dimensions I use to render D3DX fonts?

d3dxFontSprite->Begin(D3DXSPRITE_ALPHABLEND | D3DXSPRITE_SORT_TEXTURE);
d3dxFont->DrawText(d3dxFontSprite, str.c_str(), -1, &rct, 0, getD3DColor(color));
d3dxFontSprite->End();

My goal is to rotate the text about the sprite's center instead of the world origin.

Thanks.

Share this post


Link to post
Share on other sites
How can I use the RECT structure after the draw call and text is already rendered?

What I want to do is to be able to rotate text around it's center instead of the origin (0, 0)

Thanks.

Share this post


Link to post
Share on other sites
You want:

RECT rct;
rct.left = rct.top = rct.right = rct.bottom = 0;
d3dxFont->DrawText(NULL, str.c_str(), -1, &rct, DT_CALCRECT, 0);

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this