Center alignment problem in display.newText

I have two lines of text.but it display like this

"The love story  happened in 4weddings and a funeral. Actors did

not attend any birthday party."

but i need center alignment

"The love story  happened in 4weddings and a funeral. Actors did 

                           not attend any birthday party."

mycode is:

      local explText  = display.newText(“The love story  happened in 4weddings and a funeral. Actors did not attend any birthday party.”, 0, 0, 300, 25, nil, 10)

       explText:setReferencePoint( display.CenterReferencePoint )

       explText.x = display.contentWidth/2

       explText.y = display.contentHeight/2

when i used the code below code the text is centered but text is missing and only one line visible

     

        local explText  = display.newText(“The love story  happened in 4weddings and a funeral. Actors did not attend any birthday party.”, 0, 0, nil, 10)

       explText:setReferencePoint( display.CenterReferencePoint )

       explText.x = display.contentWidth/2

       explText.y = display.contentHeight/2

and there is no center alignment in corona for more than two lines of text.

how i get center alignment for more than one lines?

We don’t currently have text alignment for multiple lines. This is a requested feature that we are working on. Sorry but I can’t give you a time frame when this will be available. My only suggestion for now is the break up the multiline text into separate text objects.

Or you can use fontBox contributed by torbenratzlaff now … It is amazing!!! Get it at : 

http://developer.coronalabs.com/code/fontbox-finally-way-format-text

Does this : 

examples.jpg

We don’t currently have text alignment for multiple lines. This is a requested feature that we are working on. Sorry but I can’t give you a time frame when this will be available. My only suggestion for now is the break up the multiline text into separate text objects.

Or you can use fontBox contributed by torbenratzlaff now … It is amazing!!! Get it at : 

http://developer.coronalabs.com/code/fontbox-finally-way-format-text

Does this : 

examples.jpg

Yes, there are a few alternatives. For example, here is a more simpler approach :

https://developer.coronalabs.com/code/useful-multiline-text-library#comment-form

It’s alignment is not working because it is using the old ‘newText’. Just update it with the new version of the ‘newText’ and you are good to go!

Now display.newText has two variants. Second one was added at latest build and only it supports aligning.

Yes, there are a few alternatives. For example, here is a more simpler approach :

https://developer.coronalabs.com/code/useful-multiline-text-library#comment-form

It’s alignment is not working because it is using the old ‘newText’. Just update it with the new version of the ‘newText’ and you are good to go!

Now display.newText has two variants. Second one was added at latest build and only it supports aligning.