I have a scrollbox within a Horizontal box and I’m trying to scroll manually using GetScrollOffset and SetScrollOffset, but I can’t find a proper value for the maximum scroll so it goes past the max and takes a while to come back up.
GetDesiredSize.Y is too large a value and casting to canvas panel slot returns size 0,0.
I would like an answer too! Had to cut a feature because I couldn’t figure this out and I can’t wait around for a solution.
How can Blueprint users manually change the scroll offset - particularly scrolling to the end as the user sees it and not merely as Slate recognizes it? I had the exact same problem as OP.
I haven’t tested this in 4.10, but this is precisely what doesn’t work in 4.9 in my scenario (GetSize returns 0 for the scrollbox and GetDesiredSize returns the size of the full content)
Yup, that’s what’s happening. The workaround works great (thanks), though it’s unfortunate that it doesn’t return the proper size on the control - I’m using inheritance, so the function will be reusable, but the widgets won’t be the same.
in case someone is coming by that is wanting to use this to set up the maximum scroll value in a configuration step on construct, you cant, it will return 0 for desired size, just do it 2 frames later
The selected and upvoted answer has not worked for me; after subtracting off canvas slot sizes for parent widgets I’m still consistently left with too large of a Maximum offset.
After further investigation with the help of someone on the Unreal Slackers Discord it appears that subtracting parent canvas slot sizes are not actually providing the size of the visible geometry for ScrollBoxes inside other container/parent widgets.
The solution for these cases is to make use of the CachedGeometry exposed to blueprints for the ScrollBox and getting the local size, as so:
Great solution! Only this working perfect in my case (solutions which uses Canvas are always returns with errors, despite they are actually worked). Thank you!!!