Align Text To Center...by Setreferencepoint ?

I want to align text to center, I read some discussion this can be done by ‘setReferencePoint’, I tried to make it, but failed, anybody can show me an example??  

Here is my code: 

    message = display.newText(“TEXT HERE!! TEXT HERE!! TEXT HERE!! TEXT HERE!! TEXT HERE!!”,  140, 120, 240, 400, native.systemFontBold, 18 )

    message:setReferencePoint(display.CenterReferencePoint)

    message.x = 200

    message:setTextColor(0, 126, 255)

    

    g:insert(message)

Thanks!!

Anybody knows?

I think the problem is your trying to center text when using newText in multiline mode. They do not have any way currently to control justification in multiline mode. If it’s setup as single line, then setReferencePoint would work more to your expectation.

Oh, I can’t accept this is not possible to be done…

I am with the same problem as you… I wanted to create a 2-line label button. The button widget has a align property but it does not provide multi line. So I tried to create the label using the newText and now I have the 2-line text but I am not able to center the text… 

By the way, I already created a feature request to that…  if you can vote on it…

http://feedback.coronalabs.com/forums/188732-corona-sdk-feature-requests-feedback/suggestions/3755964-text-alignment-for-multiline-text

In the mean time, Jack van der Post just wrote in the comment of that feature request a link to a code that can create a multiline text…

Here is link to the code: 

http://developer.coronalabs.com/code/centered-multi-line-text-embossedtext-too

Thanks, just voted!!

Anybody knows?

I think the problem is your trying to center text when using newText in multiline mode. They do not have any way currently to control justification in multiline mode. If it’s setup as single line, then setReferencePoint would work more to your expectation.

Oh, I can’t accept this is not possible to be done…

I am with the same problem as you… I wanted to create a 2-line label button. The button widget has a align property but it does not provide multi line. So I tried to create the label using the newText and now I have the 2-line text but I am not able to center the text… 

By the way, I already created a feature request to that…  if you can vote on it…

http://feedback.coronalabs.com/forums/188732-corona-sdk-feature-requests-feedback/suggestions/3755964-text-alignment-for-multiline-text

In the mean time, Jack van der Post just wrote in the comment of that feature request a link to a code that can create a multiline text…

Here is link to the code: 

http://developer.coronalabs.com/code/centered-multi-line-text-embossedtext-too

Thanks, just voted!!