FDUITypes cause I got bored

Hello people!

The other day I was working on some UI for a project of mine, when I ran into an issue involving AutomaticSize.

On its own this property is pretty great, but it has flaws, like having children that have their size set to scale, causing the frame to be weirdly sized, or just not being able to customize it at all.

Me being me, and being really annoyed by how roblox’s UI stuff works decided to recreate AutomaticSize as a custom UI type!


AutomaticSize

This is currently the only type I’ve made so far, but I plan to add more in the future.
What it does? It does the exact same thing the AutomaticSize property does, except with one wonderous feature! By giving any GuiObject the attribute Ignore and setting it to true, that GuiObject will now be ignored when it scales the Frame (Ps it doesnt have to be a frame, it can be any GuiObject)

Along with that you can also make it so when it scales the frame, it doesnt just get set to the new size, it gets tweened to the new size!


Notes

I can add documentation to all of the types and how they work, but Im lazy and dont feel like it now :sob:


The Module


Documentation

This is just some base documentation cause I dont feel like it now :sob:

Name description
new Creates a new FDUIType and load it.
load Loads an existing FDUIType

Setup

Sense the types arent actually roblox instances, you have to manually load them. I personally just make a script like this that will automatically load all existing and new FDUITypes

local Module = 'Your module here'

-- // Load
local UI = 'Your GUI Here'

for _, Type in UI:GetDescendants() do
	if Type:IsA('Configuration') and Type:GetAttribute('ClassName') then
		Module.load(Type)
	end
end

UI.DescendantAdded:Connect(function(Type)
	if Type:IsA('Configuration') and Type:GetAttribute('ClassName') then
		Module.load(Type)
	end
end)

I know its not a lot right now, and it probably has bugs, but it’s helped me out a ton so I thought I could share it to anyone else who has had this problem :D

If there are any issues, or you have any questions feel free to ask!
Also if you have any tips to optimize my code please let me know!

Also tell me if the modules public or not, I checked, and I think it is, but let me know if it isnt. Alr thanks

All right thats enough rambling from me, hope this helps :D

i am back on the devforum

yes the module is public

I had a question, what does this aim to solve though?
I might be slow but I didn’t see/understand your problem in the beginning, which led to the creation of this

I’m just curious, that’s all.

So the primary issue I was facing is that I have a frame that has AutomaticSize on, and inside of that I have a frame thats supposed to take up 100% of the frame, but sense the parent frame has AutomaticSize the parent frame gets much bigger.

What I would like is that the child frame isnt taken into account when scaling the parent frame, thus allowing the child frame to just take up 100% of the space and acting as like a background ig?

I have no idea if that made and sense, but basically I want the child frame to act as the background and take up 100% of the width and scale of the parent frame without effecting the parent frames size.

That and tweens are nice so being able to tween the size is very nice :3

1 Like