A small Luau utility for fading Roblox UI.
ui_fade lets you fade a GuiBase2d and its descendants without manually tweening every transparency property yourself. It keeps track of the original transparency values it finds, so fading back in restores the UI to the state it started in.
Install with pesde:
pesde add envger/ui_fadeThen require it in your project:
local fadeUtil = require(path.to.ui_fade)local fadeUtil = require(path.to.ui_fade)
local fade = fadeUtil.new(screenGui.MainFrame)({
tweenInfo = TweenInfo.new(0.25, Enum.EasingStyle.Quad, Enum.EasingDirection.Out),
modifiers = {
[screenGui.MainFrame.Title] = { "TextTransparency", "TextStrokeTransparency" },
},
})
fade:out()
task.wait(0.25)
fade:inFade()local fade = fadeUtil.new(rootObject)(config?)Config:
ignore: instances to skipmodifiers: extra transparency properties per instancetweenInfo: tween settingswatchDescendants: automatically track new descendants
Methods:
fade:out()fade:inFade()fade:force(transparency)fade:custom(transparency, tweenInfo?)fade:refresh()fade:destroy()
The module includes built-in support for:
FrameScrollingFrameImageLabelImageButtonViewportFrameTextLabelTextButtonTextBoxCanvasGroupUIStroke