I need a way or some GuiObject that handles stretching the whole quest depending on the sizes and amount of the requirements inside (these green boxes)
so that the quest frame’s (Y) scale is set depending on whats in it, examples:
See here the quests scale perfectly to fit all of the difference amount of requirements
Heres what i got going so far. I have a ScrollingFrame holding all the Quests and its being scaled and positioned by a UIListLayout. Each Quest has a Requirements frame where a UIGridLayout handles all the requirement frames. I used different size modifiers to try and see what works best. But I dont know how to create the effect I mentioned.
Do I need to script the scaling?
I tried using UIListLayouts and UIGridLayouts but it confuses me how it works.
Using the “Offset” property seems to work but the issue is that it looks too big on mobile then.
So I need scaling
If i explained poorly i can provide more details or even the place with it if needed
The whole scaling part of GUIS just confuses me so much
local HowMuchThePlayerHas = workspace.Thing.Value
local Required = 10
while wait() do --Loop
script.Parent.Size = UDim2.new(HowMuchThePlayerHas/Required,0,1,0)
end
I would definitely not recommend this kind of scripting, while it does probably work in most cases it’s a much better idea to connect to RBXScriptSignals like from .Changed on a ValueBase. It’s especially a bad idea to use wait() in most cases and in which case task.wait() should be used
I was about to mention this.
So there arent GUI Objects that handle it? I need to script it specifically?
In a script I’d probably just update the size every time any values change yeah
If you’re wanting to scale the Y axis of the parent frame depending on the children, I would advise using a UIListLayout and either enabling AutomaticSize on the parent frame OR using a script to do it yourself like this:
local HowMuchThePlayerHas = workspace.Thing --Thing is an integer value
local Required = 10
local completedTask = false
HowMuchThePlayerHas.Changed:Connect(function(value)
script.Parent.Size = UDim2.new(HowMuchThePlayerHas/Required,0,1,0)
if value == Required then
completedTask = true
end
end)
Hii, sorry for the late bump but im still trying to figure this out.
I found out that for the canvas to resize i just needed to set AutomaticCanvasSize to the Y axis
however I am still having trouble with the frames INSIDE holding other children
I need the QUEST frame to scale to fit the frame inside holding all the requirements which can vary in size and quantity
does that make sense?
i just want the effect like in Bee Swarm Simulator
scaling is so complicated for me
So I presume this is the sort of result you’re looking for?
It really wasn’t that hard, provided you understand how AutomaticSize works in the first place. All I had to do was change the Y size of the two frames that had AutomaticSize set to Y to {0, 0}. Now they will adapt to the UIListLayout, though to the exact edge. If you want to add the little gaps at the bottom, you can use UIPadding instances to achieve that, which is what I did here.
Here’s a little demo if you’re interested: GUIScaling.rbxl (59.4 KB)