CRLF in strings when building on Windows vs MAC

Hi everyone,

I started working on my game on Windows and now also want to build it for iOS. There are strings in my game that are displayed which contain a \n\r and they cause a Carriage Return Linefeed when I built it with Corona on Windows.

When building the same project with Corona on the MAC the \r\n does cause the newline. Have other’s seen the same issues? I know that Unix has different semantics about CRLF and tried a few alternatives, like \r, \n, \n\r, LUA took pointed out \newline, but so far I couldn’t get it to work. \t in comparison seems to work fine.

Any ideas? Thoughts?

-wunderwuzzi [import]uid: 118947 topic_id: 20993 reply_id: 320993[/import]

You pretty much have to set the wrap width and height to get it to work (from my testing)

[code]
display.newText(“bla /nhello”, 0, 0, 300, 150, native.systemFontBold, 24) [import]uid: 84637 topic_id: 20993 reply_id: 82958[/import]

Excellent! Thanks for the response, specifying width and height makes it also work when building on the MAC!

There is a slight difference in behavior though, not sure if it’s something I’m doing wrong. My goal is to have each line of the text be centered.

This works when building on Windows, but when building on MAC:
[lua] button = display.newRetinaText(text, 0,0,font, size)
button.x = x
button.y = y
button:setReferencePoint(display.CenterReferencePoint)[/lua]

This works when building on MAC, but not on Windows:
[lua] button = display.newRetinaText(text, 0,0, _ W, 0,font, size)
button.x = x
button.y = y
button:setReferencePoint(display.CenterReferencePoint)[/lua]
The problem when specifying _W as width on Windows is that the text aligns on the right. It’s not a biggy and I can easily work around it by using the different implemntations depending on the platform, but not sure if there is a way to specify center alignment for each line of the text block?

–wunderwuzzi [import]uid: 118947 topic_id: 20993 reply_id: 83181[/import]

Hi. Yeah that is a request for the multiline feature that is known but not yet implemented.

The only workaround for now is to use spaces and play around until its centered [import]uid: 84637 topic_id: 20993 reply_id: 83182[/import]

Ok, thanks! [import]uid: 118947 topic_id: 20993 reply_id: 83189[/import]