How to use VBoxContainer without compressing content?

Godot Version

Godot 3.5.3


How to use a VBoxContainer together with a ScrollContainer without compressing the content inside it, I have a ScrollContainer and a VBoxContainer inside it, I created a separate panel with a texture and some information, but the entire panel and its contents collapse vertically.
If only there was some option that would compress internal content by its content, but there is no such thing, which is terribly annoying.

What is the alternative?

Show what is happening and what you expected.
From what you say I feel like all you need to do is set the ScrollContainer to expand vertically, but ScrollContainers are finicky because by definition they must ignore the size of the contents.
Provide more info.

You can set up a minimum size to every object inside the V/HBoxContainer. It’s a variable inside the inspector called “Custom Minimum Size” and it appears on any Control type node.
You can edit it either on x or y. If you let any on 0 it will resize automatically, but it you set it to 100px, for example, it will follow that forced size making its parents grow in size if needed.
I don’t know if that’s what you needed.


I have this ready-made panel (Page name), as a separate scene:

but when I placed it in VBoxContainer, only the text remained from this panel.

Set the size flags of your instantiated scene to expand and fill both horizontally and vertically.


Thank you very much, it worked!

1 Like