As a Roblox developer, it is currently too hard to create ScrollingFrames with elements that scale correctly as the CanvasSize is resized.
If Roblox is able to address this issue, it would improve my development experience because it’s a bit of a hassle to get ScrollingFrames to scale its children in a desired manner.
Currently, you have to either:
- Use AutomaticCanvasSize, which does not work correctly 100% of the time; I’ve noticed it doesn’t really work well with scaled UILayout objects.
- Use scripts to update the CanvasSize of ScrollingFrames automatically as we add/remove objects, as well as the properties of UILayout objects that position/size a ScrollingFrame’s children.
UIAspectRatioConstraints and UISizeConstraints would work to maintain size, but positioning and padding would still have to be accounted for.
Still though, it shouldn’t be any more complicated than just relying on the size being based on AbsoluteSize.
If you think about it, it doesn’t really make any sense that UI objects, who have their size properties scaled, scale according to AbsoluteCanvasSize, and not AbsoluteSize. During runtime, ScrollingFrames will almost certainly have elements that are added or removed from them, so of course, we’re going to have to resize the CanvasSize automatically so it conforms to the size of the contents.
Obviously, it makes total sense that UI objects respect AbsoluteCanvasSize when it comes to positioning them, but when it comes to size, I can’t really see a reason why size is not based on AbsoluteSize.
Let’s say we need more space for more objects in this ScrollingFrame:
The UIGridLayout is scaled:
When I resize the CanvasSize, I get this:
So, UIGridLayout respects CanvasSize. Why, though? I don’t really see why anybody would want this behavior. It should definitely be based on AbsoluteSize, not AbsoluteCanvasSize. That way, we’d be able to set the size of a UI object or the size and padding components of UILayout objects one time, and never have to worry about it again.