ChildrenTranspareny Property for GUI Objects (?)

Hello Devs,

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.

This short Video illustrates the idea;

5 Likes

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.

4 Likes

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. :thinking:

Also I think this belongs in #platform-feedback:engine-features, if not please correct me.

1 Like

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!

2 Likes

The person asking is a new member, meaning they can’t post in that category.

2 Likes

Hello and welcome to the forums.

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.

Happy developing. :slightly_smiling_face:

1 Like

It belongs in #platform-feedback:engine-features as it’s for the Roblox client as well, not just studio.

That’s my mistake, the post has been corrected. I often get confused between Studio and Engine feature requests categories.

Yes, the GUI Backend is part of the Game Engine, therefore it belongs there. I’ve made a revision to the original post.

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.

Thank again,

bumping this! I would still love to see this implemented.

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