How to make a uigridlayout make the same object sizes for all devices?

Hi,
I have a shop GUI using UIGridLayout and i have this issue:
This is how it on PC:


How it on phone:
Screenshot_189

I had an idea to pre-made a gui for phone and pc and when player joins detect on which device they are on and then give a gui for them, but maybe i can fix this somehow?

4 Likes

First, use the scale for sizing (decimal numbers representing percentages of the parent UI). They’re the first and third numbers:

{x, 0, y, 0}

Then, use UIAspectRatioConstraints to keep the same aspect ratio and prevent them from stretching out and looking too different. I’ve learned that these work with the cell size property of UIGridLayous.

1 Like

First, use the scale for sizing (decimal numbers representing percentages of the parent UI). They’re the first and third numbers:

wait where should i change this numbers? also who should be parent of UIAspectRatioConstraints?

Edit: Solved the issue

hello, I have the same issue do you mind telling us how you fixed it?
(wow sorry for 1year later reply lol)

Well, the issue was that i needed to use Scale instead of Offset in UIGridLayout’s property called “CellSize”.

What is bad:
Screenshot_387
(2nd and 4th numbers)

What is good:
Screenshot_388
(1st and 3rd numbers)

Basically you need to set 2 and 4 numbers to 0 and the other numbers (1,3) to whatever you want.

4 Likes