How to make gui fit other items

You can write your topic however you want, but you need to answer these questions:

  1. I want the gui to keep resizing the more gui items in it “basically a textlable”

image
as you can see in this image i have the textlable “Nil” i want the more stuff in leaderstats the more textlable it adds (to automate it beside keep adding to it manually) but problem is when i add more textlables this happens


the text goes out of the gui

is there anyway to check if the gui is in the gui like the more items the bigger the background gets?

I assume you are using a UIListLayout by looking at how they behave. To do this you can get the AbsoluteSize property of your original frame and compare it to your UIListLayouts AbsoluteContentSize property

1 Like

so i get these both

image

image
?

Yes you can compare AbsoluteContentSize to your frames AbsoluteSize to see if the UIListLayout is bigger than your frame.

1 Like

what do you mean by compare like to use math and some stuff?

Yes, you wanted to see if it was bigger you can do:

if UIListLayout.AbsoluteContentSize.Magnitude > Frame.AbsoluteSize.Magnitude then

end

Also I suggest using UIGridLayout for this as it is much better than UIListLayout.

UiGrid? why is that, why is it better than uilist

ok used a gridlayout but still dont know why, i use uilist as i can set the items any size but uigrid makes them all stuck with one size

UIGridLayout is usually used for frames that have the same Vector2. If you want to use UIListLayout you can, it is totally fine. Can you explain what you were trying to do in the post other than detecting if the Gui bigger? If you want the player frames to stack downwards try changing the FillDirection property of UIListLayout

nah just want it to be bigger so i can show other stats wait. how does the roblox’s leaderstats react with adding more items

A few ways you can do this:

  1. The unstable but easier way is to set AutomaticSize to your Frame and the LeaderboardFrame.
  2. The stable way is to check your UIListLayouts AbsoluteContentSize and set the LeaderboardFrames X size accordingly (or Y)
2 Likes

oh they cant handle more than 4 values well, i guess thats why i use a custom one too

i havent tried it but from reading it and having some scripting ideas i think it will work! thanks

1 Like

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