Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Tehem

DirectDraw text wrapping

This topic is 5523 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 a beginner with DirectX programming, and I need some help with text output. Here is my problem: I have my game screen, and I want to output text in a specified rectangular area. I''d like the text to have any length, and so the text should wrap when it''s too large to be on only one line. I somehow figured out a way with the DrawTextEx function. With flags like : DT_WORDBREAK|DT_END_ELLIPSIS|DT_MODIFYSTRING I get what I need, except for one thing... the text outputs nicely, but the rest of the surface is all messed up with weird green or pink lines, like when my monitor is mad about me... You can check the result here : http://thomas.marcon.free.fr/damntext.jpg You can see the limit of the surface... I tried to first fill the surface with a black background, with this : DDBLTFX ddbltfx; ZeroMemory(&ddbltfx, sizeof(ddbltfx)); ddbltfx.dwSize = sizeof(DDBLTFX); ddbltfx.dwFillColor = RGB(50, 60, 0); Blt(NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &ddbltfx); but it doesn''t seem to do anything ! I thought maybe the DrawTextEx function fill all of the given rectangular area : it writes text and then fill the rest with junk data ? Please help me, I''d like to have a nice wrapped text output, but I can''t use Direct3D our OpenGL... as I''m using only directDraw. Any idea, source piece, or whatever would be appreciated. Thanks Tehem

Share this post


Link to post
Share on other sites
Advertisement
Well I tried with different other codes, but it''s still the same problem, please help me !!

Share this post


Link to post
Share on other sites

  • 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!