Text wrapping works!

Text with text wrapping is now working! I solved my major problem in writing this engine. I had to split the string to render by whitespace, and then insert linebreaks when the length of the words was greater than the screenwidth.

Threads that helped:

  • http://stackoverflow.com/questions/236129/how-to-split-a-string-in-c (how to split a string in C++)
  • http://www.sfml-dev.org/forum/viewtopic.php?t=3225&highlight=wrap+text (pseudocode for wrapping the text)
  • http://baconipsum.com/ (delicious placeholder text!)
  • Now to generalise the splitting code so that I can also use it on the player’s response choices.

    Comments

    26. Jun 2011 · 02:38 UTC
    Your sample text sounds very… meaty! =)