Multi Line Text Height

I was wondering if it is possible to change the height of multiline text display object after creation. I am currently having a problem that my display.newText may be going outside of a certain space that I have designated it to be in (this is happening due to user input). I was wondering if it is possible to do something like the code below. I have tried the code below and I know that it does not work so is there another solution?

local textOption = { text = "", x = rectangle.x, y = rectangle.y, width = rectangle7.width - display.contentWidth/2.5, font = native.systemFontBold, fontSize = display.contentHeight/24, align = "center" } local myText = display.newText(textOption) if myText.height \> rectangle.height then myText.height = rectangle.height end

Hi @rdvitali98,

There’s not a way to adjust the line height/spacing in the text constructor, but if you intend to deal with a lot of text in your app, it’s worth exploring what this plugin can do (line height, justification, auto resizing, etc.).

https://marketplace.coronalabs.com/plugin/text-wrapper

Best regards,

Brent

Hi @rdvitali98,

There’s not a way to adjust the line height/spacing in the text constructor, but if you intend to deal with a lot of text in your app, it’s worth exploring what this plugin can do (line height, justification, auto resizing, etc.).

https://marketplace.coronalabs.com/plugin/text-wrapper

Best regards,

Brent