Help with multiline text in newTextbox

The API documents suggest text auto-wrapping is possible using something like this:

 local multiText = display.newText( "This text should be wrapped according to the specified width.", 25, 25, 175, 400, "Helvetica", 18 )  

Yet using newTextbox, auto-wrapping doesn’t seem to work. I’m trying to get text boxes to work with localized text and the only way I’ve been able to do it is with manual line breaks, which I’d rather avoid. Any ideas how to make the text wrap automatically with a textbox? Does wrapping not work with Retina text?

local string = translations[keyTable[i]][language]  
 local myText = display.newRetinaText(string, 0, 0, native.systemFont, 12)  
 textBox = native.newTextBox( x, y, w, myText.contentHeight,  
native.systemFont, 12)  
 myText:removeSelf(); myText = nil  
 textBox:setTextColor( 0, 0, 0, 255 )  
 textBox.hasBackground = true  
 textBox.text = string  
 textBox.alpha = .75  
 rulesScreenGroup:insert(textBox )  

Thanks. [import]uid: 1560 topic_id: 23198 reply_id: 323198[/import]

I believe for this particular text API you need manual line breaks, although you could do this by running through the string more easily than doing it in a truly manual fashion.

The comments here may be of use, I’m not sure - it depends on what your goal is; http://developer.anscamobile.com/reference/index/nativenewtextbox

Peach :slight_smile: [import]uid: 52491 topic_id: 23198 reply_id: 92969[/import]