Adjusting ScreenGui Transparency?
I have a ScreenGui
that has a lot of ImageLabel
s, TextLabel
s, Frame
s, etc. and I would like to adjust the transparency of ALL objects within that ScreenGui
to add a fading effect when entering the game.
So instead of doing each one by line, I'd like to use GetChildren
, and find if each child has 1 or more transparency properties, and adjust the transparencies to a set variable if it does.
So here is what I have so far:
02 | for i = 0.05 , 1 , 0.05 do |
03 | for index, child in pairs (script.Parent.Parent:GetChildren()) do |
04 | if child.Transparency ~ = nil then |
05 | child.Transparency = i |
07 | if child.TextTransparency ~ = nil then |
08 | child.TextTransparency = i |
10 | if child.BackgroundTransparency ~ = nil then |
11 | child.BackgroundTransparency = i |
13 | if child.ImageTransparency ~ = nil then |
14 | child.ImageTransparency = i |
19 | script.Parent.Parent:Destroy() |