Creating perfectly spaced GridLayout

My OCD is killing me, and I want to get this to be have all 4 sides be evenly spaced out, however I get it right, and when I do, changing screen sizes screws with it.





2 Likes

Rather use Scale only instead of using Offset. The differences between Scale and Offset is that Scale goes with resolution while Offset with pixels. By utilizing Scale it will automatically scale with the screen to fit.

If you had looked at my pictures, you’d see that I only used Scale. I never use offset

Unless you’re willing to use extra frames, this will be impossible without scripting.

If you want to avoid scripting, place all your grid items inside invisible frames. Then, set the padding on the UIGridLayout to 0. You’ll then be able to set the padding with much more granularity and control by placing UIPadding objects inside the invisible frames and adjusting as desired :slightly_smiling_face:

The reason this works is that UIPadding scales relative to its parent invisible frame, which is sized by the grid layout, whereas grid padding is scaled relative to the size of the container which it is laying out.

EDIT: alternatively in the case of wanting even padding on all four sides of an arbitrarily-sized container using UIPadding and scale only, it’s impossible. You’ll have to use scripting to set your padding in that case.

1 Like

I really want to know it too, how will I be able to do that?