Children of a scrolling frame do not scale to match device resolutions

Hello, Roblox developer community! Let me keep this simple and clear:

I am making a shop gui for a game and the only things that do not scale to match device screen resolutions are the children of a scrolling frame. Does anyone know how to make it so that the children of a scrolling frame will scale to match the resolution of any device? Please let me know!

1 Like

Please provide a video if you can!

Try looking at these posts:

Do any of those help or have you already tried those solutions? Try using scale rather than offset, also try using the UIAspectRatioConstraint.

1 Like

I tried all of the above and used UIAspectRatioConstraint. Is this scale thing part of the AutoScale Lite plugin?

1 Like

Are you sizing UI objects’ size with Scale or Offset?

e.g. {1, 0},{1, 0} = scale
{0, 50},{0, 100} = offset
{1, 50},{1, 0} = both

2 Likes

I’m sizing it with offset, it seems.

1 Like

But if it were scale, then it would not be the size I want, right?

1 Like

Okay, so Offset just scales based on pixels rather than relative to the actual size of the screen.

Scale sizes relative to the Parent size. So, let’s say our screen is 900x500 and we have a ScreenGUI the same size. If I set a Child object size to {0.5, 0}, {0.5,0} then it will be 0.5 * 900 for the X size, so 450 in offset, and 0.5 * 500 for the Y size, 250.

1 Like

Wait, so x and y must be the same number?

i have to go now but ill brbbbbb

1 Like

No, sorry, bad explanation.

They can be any number, but it sizes as a 100th / percentage of the Parent UI object. So the Scale {0.5, 0}, {0.853, 0} would make the UI object X size 50% of the Parent’s X size, and the Y 85.3% of the Parent’s Y size.

So if you have a ScreenGUI that has 1 for both Scale values, it will be 100% the size of the players’ screen, so it will be the same size as the screen.
Then, if we had a Frame in the ScreenGUI, and it had size value {0.5, 0}, {2, 0} then it would be half (50%) of the ScreenGUI’s width, and twice (200%) the ScreenGUI’s height.

Bit confusing… Is there a plugin to automate this?

1 Like

Like will I have to do calculations every time I want to create a frame?

Not really.

If you set a UI size via Scale before scaling it with dragging, then it will size itself in scale rather than offset.

If you don’t use the drag, then I try different values and estimate with my eyes, e.g. if you look at a frame, you can estimate where the halfway point is, quarter, third, etc. and just go based off of that.

But if you want to be precise, calculations are super simple if you want to do that way instead. E.g. if your ScrollingFrame is 500 in width, and the child frame is 400, then just do 400/500 and there’s your value.

If this is the measurements of one of my frames:{0, 1190},{0, 290}
How would I turn it to Scale?

The scrolling frame is {0, 1222},{0, 642} in size and {0, 0},{6, 0} in canvas size. Which do I reference?

It depends on what the Parent of the frame is. If I have Frame1 parented to Frame2, then to turn it to scale you do Frame2 / Frame1. So, Child size ÷ Parent size to convert to scale. I don’t think you need to change canvas size.

OHHH i understand thank you so much! :grinning:

1 Like

Wait, one more thing. How about if the child size is bigger than the parent size? That would return, for example, 2.2397

Yes, then you set the Scale size to 2.2397. This just means 200% bigger which is still correct and it accepts this value.

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