Library:Fade(Object, Visible)
-- // Fades an Object for 0.25 Seconds and fires the Object's fade callbacks
-- // Note: does not fade if is already fading, closes all of the content within a window
-- # Example
local Window = Library:Find("Theme")
Library:Fade(Window, false) -- // Fades the Theme Window to become invisible
-- # Example 2 (custom objects)
-- // Note: Object must contain "Outline", required for fading to function, should be the main window
local Object = {
IsVisible = false,
IsFading = false,
Cache = {}
}
local Outline = Menu.Draw("Frame", { Parent = Menu.Overlays[1], BackgroundColor3 = Color3.fromRGB(255, 0, 0), Size = UDim2.new(0, 500, 0, 450), AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.new(0.5, 0, 0.5, 0), BorderSizePixel = 0, Visible = false })
Menu.Draw("Frame", { Parent = Outline, BackgroundColor3 = Color3.fromRGB(255, 255, 255), Size = UDim2.new(1, -2, 1, -2), Position = UDim2.new(0, 1, 0, 1), BorderSizePixel = 0 })
Object["Outline"] = Outline
Library:Fade(Object, false)
Outline.Visible = false
task.delay(0.25, function()
Library:Fade(Object, true)
end)
-- // The above example uses a hacky way to fade the Object to become visible on create.
-- // It fades it to false to store the current renders in the cache, forces the outline to be invisible (so you don't see it fading to false) and then fades it to true.