Jump to content
  • Advertisement

Archived

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

Brennon

Text ??

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

Howdy, Just a quick one I hope, I have no problems placing text in the environment but I have to a lot information on the screen for a particular scene and I was wondering if anyone knows how I can just parse in a few paragraphs of text and have it show with the proper line feeds and like. In other words, i dont want to have to make a seperate call for each line of text I wish to place. Using CD3DFont in DX 9 Cheers and Beers Brennon When your nose starts to bleed, you know its time for a snooze.

Share this post


Link to post
Share on other sites
Advertisement
It''s been a while, but i believe when you are forming your character buffer to print out, i believe you can use \n to indicate a new line. So if you can align your full screen of text with line feeds, that should give you what you need when you call DrawText().

If you need exact pixel locations, i don''t know the answer.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
In other words, i dont want to have to make a seperate call for each line of text I wish to place.[/qoute]

too damn bad, you have to.

Share this post


Link to post
Share on other sites
The solution (if I really understood your problem) is quite simple :
use the sprintf() function.
It works like this:
If you want to draw the text "Hello" contained in the H str and also "Everybody" contained in the variable E you must write:

sprintf(out, "%s%s", H, E); or sprintf(out, "%s\n\n%s", H, E);
if you want two lines between the two texts...
then you write:
yourFont->DrawText(pos.x, pos.y, color, out, 0); and it will draw "Hello Everybody"

Share this post


Link to post
Share on other sites
You can make your own system to add text to a list, and display the list with 1 call. With a timer you can easily remove a text and render the other texts.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!