I’ve recently been working on an in-game store for a project of mine that relied heavily on the AutomaticCanvasSize property of ScrollingFrames. Apparently, this property is completely inept at accomplishing its only function when UIScale (or scaling in general) is used anywhere in the ancestor hierarchy in your UI. This issue becomes EXTREMELY pronounced when used in conjunction with UIScale and UIGridLayout.
As you can see, the property is entirely incapable of actually sizing the scrolling canvas according to its contents; especially when the top-level ancestor is using UIScale for more consistent multi-platform support. I’m willing to bet the issue is due to the internal code not relying on the AbsoluteSize of the contents.
Because of this issue I am now forced to completely scrap the use of this property and write my own solution. This is causing me to spend pre-allocated work hours writing code that shouldn’t need to be written.
Really hoping for a proper fix/rework of this property in the near future. It does nothing but negate productivity for UI designers that work to properly scale their designs for multiple platforms.
AutomaticCanvasSize was probably the biggest let down I’ve ever experienced when it comes to testing new features like this, absolutely didn’t deserve to be pushed in a live build of studio as it doesn’t work with UIGridLayouts like @FriendlyBiscuit mentioned…
Hi @FriendlyBiscuit - thank you for taking time to share your feedback and frustrations with AutomaticCanvasSize. I went ahead and created a high-priority ticket to address this.
To provide some transparency, there are a few critical issues ahead of this (and several other reported bugs) in the pipeline, however, resolving issues such as this is our top priority right now. We’re aware that these bugs are blocking developers such as yourself from fully utilizing AutomaticSize and AutomaticCanvasSize.
I truly appreciate your patience and personally understand the frustration of losing hours of work due to a broken feature/bug. Again, thanks so much for voicing your feedback and frustration!
That’s smart. What I did was each time a object was inserted I grabbed it’s AbsoluteSize.Y and added it to the CanvasSize’s Y offset.
-- I used the Promise module, so I had to do this each time I made a frame instead of using .ChildAdded
function createItem()
local item = itemFrame:Clone()
scrollingFrame.CanvasSize.Y.Offset = item.AbsoluteSize.Y + 5 -- 5 pixel padding
end
That’s true, I honestly forgot about the viewport size changing! Thanks for that reminder. How is performance for constantly updating it with the RenderStepped signal?
I haven’t tried it on a mass scale (only about 4 scrollingframes) but overall it’s quite smooth. You could probably do some checks before resizing it (like checking if the old absolutecontentsize is different than the new size) but overall I don’t find it to be too bad. IIRC the script activity was like 0.004%. But if you’re doing it on a large scale, maybe try doing it on every wait(), or do :GetPropertyChangedSignal on the size.
I did manage to find a workaround for my workflow in which I monitored the scale factor of the UI based on the viewport size, and manually modified CanvasSize by multiplying AbsoluteContentSize by 1 / scale_factor. It pretty much guarantees that the biggest issue (not sizing to correctly for scaled content) is directly tied to whether or not the top-level ancestor is scaled or not.
I cannot provide a snippet at this time as it uses some custom libraries that wouldn’t work in other environments. I’ll see if I can throw together a more modular solution and edit it into the OP for others who experience this issue.
This is one of the most annoying bugs I have come across. Every time I am dealing with any automatic resizing of the UI it never works. I’m currently trying to figure out how to use AutomaticSize with textbox. I’ve tried using a scrolling frame with AutomaticCanvasSize but the canvas size doesn’t change with the textbox size. The only way to get the scrolling frame to work is to use AutomaticSize on the actual size of the scrolling frame, not the canvas. I’ll probably have to go in manually and do it, which isn’t a huge deal. But I would think these features would be released in working format, especially since it’s supposed to allow a user to take less time designing UI. Instead, I end up taking longer than just hard coding the auto scaling myself.
Hi @FriendlyBiscuit , could you help confirm if the issue is still happening? If so, could you kindly provide some repro files and videos since the ones in the original post are not available. Thanks!