Hi,
I’m trying to figure out how to get a scroll box to scroll based on which child of a child is highlighted. I need to do this in blueprint since it’s controller driven.
The setup is basically:
–> Scroll Box
------> Vertical Box
--------------->Text
--------------->Grid
--------------->Text
--------------->Grid
--------------->Text
--------------->Grid
As I left stick around, I’m manually highlighting elements in the grid. The problem is that this grid can exceed the scroll box, however I’m not sure how to set the scroll offset based on the highlighted content. I’ve done OK with vertical lists by setting the offset based on a mix of desired size of the scroll box, and size of the sub-elements, but I don’t know if I can do this with my current grid setup. I know the index of the highlighted element within the grid, but don’t see a way to determine if it’s visible within the scroll box.
Ideally, I’d like the scroll box to start offsetting once the player has highlighted until midway down the grids, but I just don’t see a solution. Any advice is appreciated.
The scrollbox in 4.7 and 4.8 have some fairly terrible support for this. It will do it automatically in 4.9 provided you’re actually shifting focus using the navigation system. I’ll work on also exposing an explicit scroll to X widget for 4.9, the only way to do it before then is to some how guess the scroll offset amount needed, or to mod the source, you could probably just pull the master version of scrollbox and use it as my changes are pretty well contained. Though i think there’s some changes to slate application you’ll need as well, because I had to tweak some the way the navigation system treated explicit requests to change nav if you were not the focused widget.
Thanks ,
We’re on 4.7.6, so I’m pretty limited now, and the focus system hasn’t been mature enough yet to rely on it (it still uses that weird dotted line focus business). I guess I’ll do a hacky fix for now (RS -> scroll box, LS/D-Pad shift focus), and re-implement using real focus for a future engine version. Good to know, and thanks for the info.
Focus is much more well behaved in 4.8, with a lot more exposed functions for controlling it. Additionally there’s an option in the focus visualization enum now in the user interface project settings for None, so that people can turn off the debugging dashed line.