I have a series of buttons that are children of an hbox container. The hbox container is the child of a scroll container. What I want to do is have the selected item be centered on the screen. If you press right, the next item should become centered. If you press left, the previous item should become centered.
Is this possible with the scroll container, or should I just build a custom solution?
I don’t think it’s possible out of the box. You can only set up the scroll container to follow the focus node, but not to center it.
You might need to code it yourself. You can hook up to the focus_entered signal of the buttons and change the scroll value based on the buttons position within the container.
Ideally if the buttons are all the same width, that’ll make the calculations easier.