The label.visible property is also affected by the Label:show() and Label:hide() methods.
Label.visible read/write property
Get or set the label visibility on screen, a true value means that the Label is shown, a false value means that the Label is hidden.
Example
local ui = require "ui"
-- create a simple label
local win = ui.Window("Label.visible sample", 320, 200)
local label = ui.Label(win, "LuaRT", 120, 70)
local button = ui.Button(win, "Click to hide label", 100, 10)
label.font = "Impact"
label.fontsize = 24
-- hides the label and shows it again after 2 sec
function button:onClick()
label.visible = false
button.enabled = false
sleep(2000)
button.enabled = true
label.visible = true
end
win:show()
-- update the user interface until the user closes the label
repeat
ui.update()
until not win.visible