newButtton labelAlign

Im trying to create a new button that has some text in it, but for some reason the label is not behaving as I would expect.

  1. If I do it like this, then the text is not really centered (the “Start” and “over” are actually aligned left)…

        local buttZero = widget.newButton{

            width = 50,

            height = 30,

            labelAlign = “center”,

            label = “Start\nover”,

            fontSize = 14,

        }

  1. If I do it like this (no \n), then the text “crosses” the border of the button (it does not break the text in two lines).

        local buttZero = widget.newButton{

            width = 50,

            height = 30,

            labelAlign = “center”,

            label = “Start over”,

            fontSize = 14,

        }

Am I doing something wrong?

Hi @marcior,

I don’t think that the internal widget button label supports multi-line text. For this, you may need to place your own text over the button widget, and size the overall button accordingly.

Best regards,

Brent

Hi @marcior,

I don’t think that the internal widget button label supports multi-line text. For this, you may need to place your own text over the button widget, and size the overall button accordingly.

Best regards,

Brent