Tag Archives: horizontal center

Corona SDK: Center text horizontally

How to center text horizontally with Corona SDK:

local aboutText = display.newText("", 0, 0, native.systemFontBold, 13)
aboutText:setReferencePoint(display.CenterReferencePoint)
aboutText.x = display.contentWidth * 0.5
aboutText.y = display.contentHeight * 0.5 - 30<
aboutText:setTextColor(255, 255, 255)
aboutText.text = "Horizontal centered!"