Is there a way to auto scale UI Until it reaches a certain size?

Hi All,

I’ve been searching around for an answer to this but I can’t really find anything for it. I’m trying to make a leaderboard that autoscales with the amount of players in it but stops after it reaches a certain Y size.

I’ve tried using the AutomaticScale option in the frame and tossing on a UISizeConstraint, but I don’t think i Understand how UISizeConstraint works because it doesn’t seem to do anything.

I basically just want this to stop autoscaling after the 10th or 11th frame added to the ScrollingFrame:
3fbce636326acacee64cd7ab280abdb9

If anyone knows a solution to this it would be greatly appreciated

1 Like

why do u need this? just don’t add any more instances to the scrolling frame

Use UISizeConstraints.

What do you mean by autoscale? Like it just keeps increasing in length? If so you could add a scroll frame.

Or if it’s not vital for gameplay you could limit the server size, it’ll help reduce lag at least :sweat_smile:

I want to make the Leaderboard small when there’s not that many players online so there isn’t a full sized blank leaderboard taking up space in the cornor of the screen.

But I also want it to stop auto scaling at a certain point so it doesn’t take up too much space and end up becoming the entire right screen

This doesn’t work with automatic scaling (atleast from my testing)

Hmm, maybe you can try using scripts? Have a script which checks for the amount of frames and have it increase the frames size accordingly.

1 Like

Turns out a bit of hardcode was the solution.

if curVag <= #PLRS:GetPlayers() - 11 then
		core.AutomaticSize = Enum.AutomaticSize.None
		core.FPlayers.AutomaticSize = Enum.AutomaticSize.None
		core.Size = UDim2.new(0,166,0,311)
		core.FPlayers.Size = UDim2.new(0,160,0,273)
	else
		core.AutomaticSize = Enum.AutomaticSize.Y
		core.FPlayers.AutomaticSize = Enum.AutomaticSize.Y
		core.Size = UDim2.new(0,166,0,25)
		core.FPlayers.Size = UDim2.new(0,160,0,35)
	end

ed8d7996f92d39c525d513dc7439e908

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.