How to maintain content size of a scrolling frame with offset (or scale)

I’m currently working with scrolling frames, and I made a auto canvas resize so I don’t have to bother resizing other buttons, it works with offset, it doesn’t change the size of it’s children, but if I do scale it stretches it.

(P.S. UIGrid Layout ^)

BUT, my issue is that if the UI Grid Layout is set with offset, it doesn’t maintain it’s size when changing windows

Example

Offset:

Scale:

“So why don’t you keep it on scale”

Because my auto canvas resize script is messing with the content size and it stretches it depending on more content

Example:

This has been done before, in Flee the Facility

If anyone got a solution for this hollar at me in the replies

1 Like

You wanna use in the position and size properties only Scale values, which basically autoscale on every device.

--heres an example with a Frame

--LocalScript
local Frame = Instance.new("Frame")
Frame.Parent = script.Parent --PlayerGui

Frame.Size = UDim2.new(1,0,1,0) --This will make the Frame as big as your screensize. It's scaled on all devices to 1 (1 = 100%) and would cover your screen.

Frame.Position 0 UDim2.new(0,0,0,0) --This would place the Frame to 0 and 0 on all screens.
--UDim2.new(ScaleX,OffsetX,ScaleY,OffsetY)
--You wanna see Scale as screen size resized for everyone
--You wanna see Offset like the size which is replicated on your screen, replicated the same as on others screens. So if you'd make a Frame which is maybe big as your screen, but positioned and sized on offset, it would fit on your screen but not on the other peoples screen with a different screen size.

I hope this helped.

1 Like

I don’t think you get what I’m trying to achieve

The problem is the children inside the scrolling frame, with UIGridLayout

Just scale them and scale the grid aswell, use this plugin as help
Autoscale Lite

Are you looking for such a scaling?

It didn’t work, I need something alternative other than scaling because I doubt scaling will help in any situation

no, you do not get what I mean, the children inside stay the same size, so if I play on mobile they will be too large inside the scrolling frame, you can prevent that by doing scale instead of offset on the uigridlayout sizing, I NEED offset because my auto sizing canvas doesn’t mess with it’s childrens size, SCALE does

I would set I to the same thing thst you have eith the others as a ui I had this issue before but when I scaled them all the same and put them in there the problem fixed.

Elaborate, my issue only is the buttons inside the scrolling frame

May I see your ScrollingFrame properties? You might messed up something with it.

It’s a normal scrolling frame, only used the scale plugin so it fits on all devices, other than that I didn’t mess with anything

Hmm weird… Does your AutomaticSize ScrollingFrame’s Property is set to None?

yea, I use UI Grid Layout for the scrolling frame, I made a script that auto does the canvas size depending on it’s children count, whenever I use 1, 0, 1, 0 (scale) it would work but it stretches the buttons as the canvas updates, it also has a positive side is that it scales on all windows

BUT 0, 1, 0, 1 (offset) WORKS just how I wanted it, only downside is that it doesn’t scale to it’s windows

Wait wait wait you’re telling me you’re using script to automatic canvas size depending on its children counts? (Because I think it’s because of your script)

And also have you check ever out a property ScrollingFrame called automaticCanvasSize?

I would use the roblox one’s.

1 Like

They removed automatic canvas size last year, you’re sleeping

Wait nevermind, I’m the one who’s sleeping, wuudahel

Give me a minute amma try something real quick

I don’t know if I’m stupid or anything, I thought I saw a topic where they removed it, :man_facepalming: again one of the simplest problems turning into a 2 hour work, regular me but appreciate you @Humaidi_0

Have a great day

2 Likes

CanvasSize set to UDim2.new(0, 0, 0, 0) and AutomaticCanvasSize to ‘X’, ‘Y’, or ‘XY’ (depending on the context) should work fine, UILayouts which constrain the size and/or padding of elements should be assigned values according to offset as opposed to scale.

4 Likes