Type String Object TextObject Library display.* Revision 2017.3060 Keywords text, string, label See also textObject.size
display.newText()
Retrieves or sets the text string of a text object.
When you change the text string of a text object, you should also reset its anchor point and x/y position again. Doing this ensures that the object remains aligned to the original position.
local myText = display.newText( "Hello", 0, 0, native.systemFont, 12 ) myText.x = 50 ; myText.y = 50 myText:setFillColor( 1, 1, 1 ) myText.anchorX = 0 -- Change the text myText.text = "Hello World!"