UIGridLayout Scaling Issue

, ,

What do I want to achieve? I want to keep the UIGridLayout while being able to have the buttons in the ScrollingFrame scale between all devices.

What is the issue? The ScrollingFrame buttons perfectly are fine on PC, but when mobile players try to view the UI, the buttons are gigantic and won’t scale perfectly.

Image2

What solutions have you tried so far? I have checked all the previous DevForum posts on this topic, but none of them have actually helped. I have tried putting UIAspectRatioConstraints in each of the buttons to help the scaling issue, but it still seems to not be working. All the UI has been set to Scale instead of Offset so I am aware that isn’t the case.

4 Likes

What are the properties of your UIGridLayout? The sizes of the individual elements don’t matter, since UIGridLayout takes control over .Size.

1 Like

Properties

Did you try controlling the size with the scale value?

2 Likes

Does this refer to your question or do you mean something else?

You are using offset, not scale, inside of the UIGridLayout.

Try using a UDim2, more similar to this:

(0.4,0,0.4,0)

You may however, need to use a UIAspectRatioConstraint, in order to maintain the correct ratio on the guis.

3 Likes

Well using the scale values help me most of the times. Also I think there are plugins for that.

1 Like

Thanks for helping me catch the offset scaling through the UIGridLayout, but it seems to not be working still on mobile… am I still missing something?

1 Like

It seems you still didn’t change the CellSize, to work with Scale. You made the padding work with Scale, but not the Size.

2 Likes

I completely missed that, thanks! The final issue is that I’m not sure where they went… I know the ZIndex isn’t the problem.

What did you set the CellSize to? Can you find them in the explorer?

1 Like

The CellSize is still the same except I changed it from Offset to Scale.image

The problem isn’t that your elements are too small, it’s that they are WAY to big.

Scale works by percentage of total screen size, 1 being the entirely of the screen, and 0 being none of the screen.

Try changing it to something more like (0.2,0,0.2,0), and tweek it from there.

6 Likes

Why is the cell size so high?
30chars

1 Like

They work completely now, but I’m not sure how to move them up, since there is a gap.

You could try lowering the padding, but this seems like a problem with the Frame that is the Parent of all of the elements. Try moving the Parent frame up a tad.

I know im very very very late, but maybe it’s actually because of UIAspectRatioConstraint, did you use that for the buttons? if you did, try playing with the UIAspectRatioConstraint and the Height scaling of the buttons using the UIGridLayout