How to convert a UI grid layout's cell size from offset to scale

Hello! I am making a scrolling frame with a GUI grid layout and I’ve already made the template and everything. The grid layout’s cell padding and cell size is currently in offset and so the frame scales differently on different devices. Is there any way to convert the size and padding to scale without restarting everything? Thank you!

You can use this plugin:
AutoScale Lite - Roblox

I have an auto scale plugin, but right now, I need something for a UI grid layout, and I don’t think that works for it. Thanks!

You might just have to keep messing with the values until it fits. I don’t think there is another way.

Oh alright, thanks for the help!

A good and easy fix for this instead of messing with UIGridLayout sizes (which can give really squished results), you can put a UIAspectRatioConstraint inside each children of the scrolling frame and set the aspect ratio to 1 so it will remain a square regarding the sizes in the GridLayout…
image

2 Likes

you can do this easily by dividing the cellsize to the absolute size of the parent.

local selected = game:GetService("Selection"):Get() local scale = selected[1].Parent.AbsoluteSize local size = selected[1].CellSize selected[1].CellSize = UDim2.new(selected[1].CellSize.X.Offset/scale.X,0,selected[1].CellSize.Y.Offset/scale.Y,0)

this script will automatically scale uigridlayout based on the parents absolute size. it will work for normal frames but wont work for scrolling frame. if you want scrolling frame one you’ll need to change the scale from .AbsoluteSize to .CanvasAbsoluteSize since in scrolling frame ui scale is following the canvas size instead of the parent size.

3 Likes