Jump to content
  • Advertisement
Sign in to follow this  
skwee

[SDL_ttf] Blit multiply lines?

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

Hey. I'm using SDL_ttf to blit text to screen. In order to blit more that one line of text I blit this text line by line. I blit first line free the surface load another line to this surface blit him and all over again while not finished to blit all. Now i want to know is there any option to blit multiply lines using the blit function only once? I mean something like SDL_BlitSurface(TTF_RenderText_Solid("Hey\nthis is\nmultiply\nline", color), NULL, g_Screen, NULL); ? Thanks a lot

Share this post


Link to post
Share on other sites
Advertisement
Not to my knowledge. Sorry. SDL_ttf is a text rendering engine, not a text layout engine.
However, it shouldn't be too hard write your own function to return to a set point plus a certain offset on each newline. :)

And, be careful with TTF_RenderText_Solid(). It allocates a new surface, that has to be freed with SDL_FreeSurface() once you're done with it.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!