How do you use ScrollContainers?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By SupToasty
:warning: Old Version Published before Godot 3 was released.

enter image description hereEven when I have more items in the tree and I drag the scroll bar the items don’t move. Do I have to script this?

:bust_in_silhouette: Reply From: kubecz3k

You don’t need to put additional ScrollBar into ScrolContainer, there are two properties of ScrolContainer: Horizonal and Vertical. If you check them proper scroll will show automatically.
for example:

  1. Put new Scroll Container on the scene.
  2. Set it’s size
  3. Turn on Vertical and Horizontal
  4. Put Button Node as a child of Scrool Container
  5. Set Button MinSize to something greater than size of ScrollContainer
  6. Turn on the scene and play with scrolling

Am I able to reposition the scroll bar that is generated?

SupToasty | 2016-04-22 13:22

As far as I know you will be unable to reposition it, at least there is no api for this. If you need scroll in some non standard place then maybe you need to create and program this container on yourself after all…

kubecz3k | 2016-04-22 13:47

All right I’ll mess around with things if I can’t find an alternative design that fits. Thanks kubecz3k.

SupToasty | 2016-04-22 16:11

You are able to get a node reference to the scrollbars using the get_h_scrollbar and get_v_scrollbar functions. You can probably then just set the rect_position value to whatever you want.

Shaqpower3 | 2021-06-05 16:36