OnHidden||doc136706

September 20, 2022

Format

local event = Window:GetEvent("OnHidden")

Describe

Visible = false triggers an event when the target control is switched to invisible.

Callback function parameters

Type name introduce
Window window current window

Code example

local event = UI.Root:GetEvent("OnHidden")
event:Bind(function(window)
    print("UI hide!")
end)

-- Create a Image widget
local window = UI:CreateGUIWidget(Enum.WidgetType.Image, "childImage")
window.Parent = UI.Root

-- Hide all UI
UI.Root.Visible = false