How to center the more than one object?

I have four buttons. I want them in the center.

I tried the helloworld app to display text. when i give 0,0 to x and y axis, i can only see the “world”. Hello was missing.

local textObject = display.newText( "Hello World!", 0, 0, native.systemFont, 24 )

Only World! is visible.

One button size is 64px

math.round(( display.contentWidth / 2 ) - ( ( 4 \* ( buttonWidth ) + 15 ) / 2 ))

four buttons and each button will have 15px space between each other. So, the above calculation will give the x axis for the first button. So, i can place other buttons accordingly. But these codes are not working.

This is because coordinate 0,0 is on the top left corner, while your text object is centered-referenced.

Try this :

local textObject = display.newText( "Hello World!", display.contentCenterX, display.contentCenterY, native.systemFont, 24 )

This is because coordinate 0,0 is on the top left corner, while your text object is centered-referenced.

Try this :

local textObject = display.newText( "Hello World!", display.contentCenterX, display.contentCenterY, native.systemFont, 24 )