When set to "center", newline characters
"\n"
don't generate new lines when displaying the text of the Label
Label.textalign read/write property
Get or set the Label text alignment, a string value that represent how the text will be displayed.
Example
local ui = require "ui"
-- create a simple Window
local win = ui.Window("Label.textalign sample", 320, 200)
local label = ui.Label(win, "LuaRT")
label:center()
-- create a combobox
local cb = ui.Combobox(win, { "left", "center", "right" }, 100, label.y + 32)
cb.selected = cb.items[1]
-- change label.textalign property upon selection
function cb:onSelect(item)
label.textalign = item.text
end
win:show()
-- update the user interface until the user closes the Window
ui.run(win):wait()