Sign in to follow this  

text clipping in DX9

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

Hello, I'm printing text using ID3DXFont interface in DirectX 9, the text is moved around in the window, but must be clipped within a given window. I successfully use SetScissorRect(&rc) with the clipping boundaries in the rc rectangle for the geometry (triangles, quads, ...) but it does not work with the ID3DXFont objects. Any idea ?

Share this post


Link to post
Share on other sites
You can check the limits of the rectangle used to draw the text against the window rectangle.

RECT rect;
// set up and check rect here
font->DrawText(..., &rect, ...); // don't use DT_NOCLIP in the flags

Share this post


Link to post
Share on other sites
Hi,

Thanks for the answer, however it works partly : it works perfectly well for ordinary text. Now I also use rotated text, and in that case I can only clip the text along its own axis (length and height).
For example, if I rotate a text by 45° and move it to a place where it has to be clipped along a horizontal line, that won't do it.

Anyone has an idea of why the scissor are desactivated with sprites or ID3DXFont objects ?

Share this post


Link to post
Share on other sites
Quote:
Original post by oliver_mpt
Anyone has an idea of why the scissor are desactivated with sprites or ID3DXFont objects ?
Because you don't usually want the scissor enabled when rendering sprites. If you do, just turn it on after calling ID3DXSprite::Begin().

Share this post


Link to post
Share on other sites

This topic is 2849 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.

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