Centering a Paragraph in Lua

Okay, so I’m just learning the Lua language in my Mobile Apps class at school. I learned how to show text on the screen and I was shown how to drop the text down a line (using “\n” within the text). I was also shown how to center a variable using the “displayWidth/2” line.

But how can I get a paragraph, such as the one below, to center each line individually without having to write a variable for each line within the paragraph?

“This is
a paragraph
that I want to center”

Hope this question makes sense! [import]uid: 219784 topic_id: 35621 reply_id: 335621[/import]

Corona SDK currently does not support text justification of multiple lines within a box. We can center the box, but not the text within the box.

Please go to http://feedback.coronalabs.com and find the feature request for this and vote for it.

[import]uid: 199310 topic_id: 35621 reply_id: 141631[/import]

Corona SDK currently does not support text justification of multiple lines within a box. We can center the box, but not the text within the box.

Please go to http://feedback.coronalabs.com and find the feature request for this and vote for it.

[import]uid: 199310 topic_id: 35621 reply_id: 141631[/import]