Displaying elements within ScrollContainer

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Droggelbecher

Hello,

I’m struggling with the ScrollContainer node. I want to display a list of panels which contain multiple TextureButton and Label nodes.

This is my tree structure:

-ScrollContainer
– VBoxContainer
— Panel
---- Label
---- TextureButton
---- TextureButton
— Panel
---- Label
---- TextureButton
---- TextureButton

The Separation value of the VBoxContainer is activated and set to a value above 0. Unfortunately, the Panel nodes and their children aren’t displayed at all. Only basic buttons and labels seem to work inside a VBoxContainer.

Older explanations suggest to work with Control nodes within VBoxContainer, but that solution didn’t help. The official documentation wasn’t very informative either.

Does someone know how to use the ScrollContainer properly or is there a better way to create such a list?

:bust_in_silhouette: Reply From: Wakatta

The tree structure you have there should work just fine.
Try adjusting the Rect Values of your VBoxContainer and Panels within the SrollContainer.
Most specifically the Min Size.

:bust_in_silhouette: Reply From: klaas

Hi,
my experience is … panels only work when used with fixed sizes. If you want a fluid layout use vbox and hbox. Stack as many as you need. So make the panels another vBox. that should work way better.

:bust_in_silhouette: Reply From: Droggelbecher

The scroll container works fine now, but the last element won"t be displayed. This seems to be an older bug. I solved the problem by adding an empty panel at the end.