0 votes

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?

in Engine by (37 points)

3 Answers

+1 vote
Best answer

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.

by (482 points)
selected by
+1 vote

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.

by (2,430 points)
0 votes

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.

by (37 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.

Categories