Jump to content
  • Advertisement
Sign in to follow this  
Tispe

[DX9] DrawTextA() distorting text

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

Hi, first time poster here, be gentle.

When I draw text onto a sprite, some characters gets cropped. You can see for yourself in this screenshot: http://img202.imageshack.us/img202/2895/choppytext.png

The user types on the keyboard and it appears on a "command log". Each line has its own RECT. And each line is drawn in a FOR loop.

As you can see, some characters are "cropped", a vertical line of pixels is sometimes removed.

Someone mentioned to me that the render surface might be smaller then what I need so some pixels gets aliased

code:

D3DXCreateFont(d3ddev,
22,
0,
FW_NORMAL,
0,
false,
DEFAULT_CHARSET,
OUT_DEFAULT_PRECIS,
ANTIALIASED_QUALITY,
DEFAULT_PITCH | FF_DONTCARE,
L"Arial",
&dxfont);

and:
dxfont->DrawTextA(d3dspt,ary[k],str[k].length(),&textbox[k],DT_LEFT | DT_VCENTER,D3DCOLOR_ARGB(255, 255, 0, 0));

Any clues?

Share this post


Link to post
Share on other sites
Advertisement
ok, apperantly the "client window" size includes boarders and menu, so I would need to add some extra height and width to compensate. and there is a AdjustWindowRectEx to do so. If only tutorials would include this information :)

Share this post


Link to post
Share on other sites
Quote:
Original post by Tispe
ok, apperantly the "client window" size includes boarders and menu, so I would need to add some extra height and width to compensate. and there is a AdjustWindowRectEx to do so. If only tutorials would include this information :)
And that's one of the many reasons why I hate directxtutorial.com :P

The client area is the "internal" window size:

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!