We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi, I'm utilizing the text() function for a project of mine, and the typical \n line break within a string does not work inside that function (but it does for print statements).
Is there any way to get line breaks in a text() function without using separate strings?
Answers
text comes also with 5 params, but you don't have much control where it breaks
but it puts the text in a box then
your \n works.....
The \n doesn't work in p5.js, It does in processing
I ran across this issue too. Just put <br> where the line needs to break.
When I do that, I get "Uncaught SyntaxError: Unexpected token ILLEGAL ". Javascript, at least in Chrome, won't accept an Enter character.
Internet explorer returns: "SCRIPT1015: Unterminated string constant"
.
Chrisir's box solution works well enough, thanks! It's not as precise as I might want, meaning I can't put line breaks wherever I want, but it does the job.
Thanks again guys.
Details on the text box are here: http://p5js.org/reference/#/p5/text
Post that issue on P5.JS's GitHub: https://github.com/lmccart/p5.js/issues O:-)
done!
https://github.com/lmccart/p5.js/issues/446
thanks! will work on it over there