{"author_name":"JigxorAndy","cat":"MiniLD","comments":[{"author_name":"","time":"June 25, 2011 9:38 pm","epoch":1309055880,"text":"Your sample text sounds very&#8230; meaty!  =)","spam":"N"}],"epoch":1309044120,"likes":1,"metadata":{"p_key":"65535","p_author":"JigxorAndy","p_authorkey":"507377","p_urlkey":"101331","p_title":"Text wrapping works!","p_cat":"MiniLD","p_event":"LD20","p_time":"1309044120","p_likes":"1","p_comments":"1","p_status":"UPD5","us_key":"507377","us_name":"JigxorAndy","us_username":"JigxorAndy","event_start":"1304035200","event_key":"6","event_name":"LD20"},"text":"<p><a href=\"http:\/\/www.ludumdare.com\/compo\/2011\/06\/25\/text-wrapping-works\/baconipsum\/\" rel=\"attachment wp-att-55765\"><img src=\"http:\/\/www.ludumdare.com\/compo\/wp-content\/uploads\/2011\/06\/baconipsum-300x159.png\" alt=\"\" width=\"300\" height=\"159\" class=\"aligncenter size-medium wp-image-55765\" srcset=\"http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2011\/06\/baconipsum-300x159.png 300w, http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2011\/06\/baconipsum-550x292.png 550w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n <p>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.<\/p>\n <p>Threads that helped:<\/p>\n <li><a href=\"http:\/\/stackoverflow.com\/questions\/236129\/how-to-split-a-string-in-c\">http:\/\/stackoverflow.com\/questions\/236129\/how-to-split-a-string-in-c<\/a> (how to split a string in C++)\n <li><a href=\"http:\/\/www.sfml-dev.org\/forum\/viewtopic.php?t=3225&amp;highlight=wrap+text\">http:\/\/www.sfml-dev.org\/forum\/viewtopic.php?t=3225&amp;highlight=wrap+text <\/a>(pseudocode for wrapping the text)\n <li><a href=\"http:\/\/baconipsum.com\/\">http:\/\/baconipsum.com\/<\/a> (delicious placeholder text!)<\/li>\n <p>Now to generalise the splitting code so that I can also use it on the player&#8217;s response choices.<\/p>","time":"June 25th, 2011 6:22 pm","title":"Text wrapping works!"}