How can i make a textbox which holds together multi-lines text?

 [lua]

  local options =
    {
        text= questions,
        x = 0,
        y = 0,
        width = value - border*2,
        font = native.systemFont,
        fontSize = 16,

    }

    local gameQuestion1 = display.newText(questions, 50,200,500,50, native.systemFont, 18)
    gameQuestion1:setFillColor(50)
 [/lua]

How can i make a Text Box which holds a multi-line text, for example

i want “Where are you?” to be enclosed in a small text box, then when a button is pressed a new text will be displayed like “What are you doing and who are you with?” is a long sentence and i also i want it to be enclosed in the same text box, but larger.

Hi @naughty.kidd27,

It looks like you’re not using the “options” table parameters when you first create the text object. Try doing this:

[lua]

local gameQuestion1 = display.newText( options )

[/lua]

But, are you also saying that you want the overall width of the text-containing box to change widths? Such that when you display just one line, it doesn’t wrap lines, but when you display a multi-line question, the width reduces and it wraps lines? That sort of thing wouldn’t be possible with just one text object… you’d need to create two text objects, and replace/update the text of the appropriate object as needed.

Brent

Hi @naughty.kidd27,

It looks like you’re not using the “options” table parameters when you first create the text object. Try doing this:

[lua]

local gameQuestion1 = display.newText( options )

[/lua]

But, are you also saying that you want the overall width of the text-containing box to change widths? Such that when you display just one line, it doesn’t wrap lines, but when you display a multi-line question, the width reduces and it wraps lines? That sort of thing wouldn’t be possible with just one text object… you’d need to create two text objects, and replace/update the text of the appropriate object as needed.

Brent