fontSize (optional)

Number. The size of the text in Corona content points. The system's default font size will be used if this parameter is omitted or if it's set to nil or 0.

Important

To change the font size of a text object after it has been created, set the object.size property, notobject.fontSize.

align (optional)

String. This specifies the alignment of the text when the width is known, meaning it either contains a newline or the width parameter is supplied. Default value is "left". Valid values are "left", "center", or "right".

Syntax (Legacy)

Note that text alignment, for example "center" or "right", only works with the modern syntax (see above).

fontSize (optional)

Number. The size of the text in Corona content points. The system's default font size will be used if this parameter is omitted or if it's set to nil or 0.

Important

To change the font size of a text object after it has been created, set the object.size property, notobject.fontSize.

Gotchas

The newText() object uses a mask when the object is created. There is a nested masking limit of 3, so care must be taken when inserting masked objects into other masked objects which act as containers, including display.newContainer, widget.newScrollView, widget.newTableView, or a masked display group. Other display objects that utilize masks include display.newEmbossedText and any other masked display object. If you exceed the mask nesting limit, the text may appear as a solid white block. For example, a text object (one mask) inside a container (one mask) inside yet another container (one mask) would reach but not exceed the limit of 3 nested masks.

When rendering a multi-line box of text, be careful that the final display object does not exceed any target device's maximum texture size limit. If you need to render text objects with a large number of lines, you should create multiple text objects and position them one after the next.