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 ![]()
The Module
Documentation
This is just some base documentation cause I dont feel like it now ![]()
| 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