How to evenly space UI Elements?

So I have recently ran into an issue when designing my UI.

I have a lot of different shapes and sizes of UI frames that are in a ScreenGui, what I need to do is make them all 30 pixels away from each other, along with 30 pixels away from the sides of the screen.

Sounds simple, it isnt :[
So Im using a UIPadding to keep everything away from the sides, the problem is that keeping the frames 30 px away from each other is pushing them in a way, where they are no longer 30px from the border.

So the main thing I’d need is just some way to make all the frames evenly spaced out within the ScreenGui (Or whatever its parent might be). Any Ideas?

Use UIListLayout flex properties and set it’s HorizontalFlex to anything you find suitable. Something like Fill would do but it would distort your elements a bit.

1 Like

Just cause Im curious if you know, is there a way to make the elements fit? So it would only scale elements when they overflow so everything fits in the parent?

If not its ok Ill just have to make it myself lol

Does setting it to Fill not work? Can you explain using a diagram or something?

fill basically just stretches everything to well, “fill” the parent element.

Wait that sounded weird.

Fit would just make it so all of the parent elements children fit inside of it, so if they overflow, it scales them down to fit inside of the parent element, hence the name, fit lol.

PS: The White Frames size on the Y axis is 0. and VerticalFlex is set to Fill

For instance when I have fill set for verticalFlex, no matter what the the size of the white frame on the Y axis is, it’ll always take up the entire space (unless there are other frames below it)

Fit would just again, just fit all the stuff inside of the frame.
I cant draw at all so thats why I didnt make a diagram lol

So you’re saying, you want the gui to not try smushing every frame into one column right? For that, you need to use UISizeConstraint.

1 Like

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