I wasn’t quite sure where to stick this thread, although I have recently been working with GUI objects and came to, possibly not a problem/issue, but the lack of a feature which would aid UI creators.
Idea; ChildrenTransparency Property for GUI Objects, which basically would affect all the Transparency of all contents of a Frame (for example). This would save you from having to drop scripts which fade out each single bit of your GUI. For example fading out an entire complex menu, shop, inventory etc.
Currently all ‘Transparency’ properties of GUI objects are object-specific such as ImageTransparency and BackgroundTransparency. Introducing a simple GuiObject.Transparency property which applies to background/image/text would be a large improvement to this current implementation.
Since the individual transparencies can already be controlled through their own properties, I think it would make sense if GuiObject.Transparency would apply transparency to all child objects as well.
My current method to change the transparency of the GUI Objects is by using GetDescendants() in a for loop, shifting the transparency for each object descendant to a frame. Within the loop, I added if statements to check if the object is a ImageLabel, TextLabel, Frame, TextButton etc. TweenService is an option to change the transparency, which I am currently using.
I’m considering creating my personal function to shift the UI transparency, with a few parameters for easier tweaking.
Also I think this belongs in #platform-feedback:engine-features, if not please correct me.
This has been suggested many many many times before. I still support it as a UI Constraint style instance which ‘multiplies’ the transparency properties of descendant GUI objects!
This thread is classified as a “feature request” relating to the GUI backend, which belongs in the #platform-feedback:engine-features category. As a New Member, you cannot create topics in this category. A note as well in the future; try to make use of the search bar. A related feature request already exists, which I believe does cover what you’re asking for.
Upon being promoted to New Member, you will notice that you received a DM from the system containing information you’ll require for using the forums. Among them is the New Member FAQ which details how to file a feature request. Please be sure to read through that.
The Scripting Support category is a place for asking questions as they pertain to Roblox programming and gaining support in doing so, while the Platform Feedback categories are for suggestions and bug reports for Roblox. Be sure to check out the categories before making a post.
If you have any questions about the forums, be sure to DM the Lead Top Contributor group or hit up the Inception category.
Thanks for the reply, I have been linked with a thread minutes after posting this. And as a New Member I was not able to post in the correct category unfortunately.
This is possible by having a function that gets the objects type:
Here it is illustrated:
local function GetProperty(Object)
if Object:IsA("TextLabel") or Object:IsA("TextButton") or Object:IsA("TextBox") then
return "TextTransparency"
elseif Object:IsA("ViewportFrame") or Object:IsA("ImageButton") or Object:IsA("ImageLabel") then
return "ImageTransparency"
elseif Object:IsA("Frame") then
return "BackgroundTransparency"
end
end
Simply just have a for loop that goes through each child of the GUI, makes sure its a Frame or button/text, then a tween that tweens the transparency.
Ex:
function FadeIn(Object, FadeTime,Transparency)
local TI = TweenInfo.new(FadeTime, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
local Table = Object:GetDescendants()
Table[#Table + 1] = Object
for i,v in pairs(Table) do
local Property = GetProperty(v)
if Property then
if v:FindFirstChild("DefaultTransparencyValue") then
TweenService:Create(v, TI, {[Property] = Transparency}):Play()
else
local DefaultTransparencyValue = Instance.new("NumberValue")
DefaultTransparencyValue.Name = "DefaultTransparencyValue"
DefaultTransparencyValue.Value = v[Property]
DefaultTransparencyValue.Parent = v
v[Property] = 1
TweenService:Create(v, TI, {[Property] = v:FindFirstChild("DefaultTransparencyValue").Value}):Play()
end
end
Property = nil
end
TI = nil
Table = nil
end