We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Is there an easy way to draw a box behind text? ... or how would you find the exact size of the area a string will occupy, depending the size and font and taking in consideration the enter character ("\n" )?
thanks
Answers
Have you tried text() w/ 5 parametrs?:
text(str, x1, y1, x2, y2)
https://Processing.org/reference/text_.html
it's hard one...
look at https://www.processing.org/reference/textWidth_.html
when you use \n you could count the \n in the text and thus get the numbers of lines, the height (depending on https://www.processing.org/reference/textLeading_.html and https://www.processing.org/reference/textSize_.html)
Oh cool, both pointers are very useful. I hadn't noticed text() can take a extra parameters. thank you guys!