How to create list of buttons that show sub-buttons after clicking on them +scroll

Godot Version

v4.5.1

Question

Hey, so I currently try to make a small text-idle game. I tried to make menu of buttons that have names of countries and after clicking on one of those button, sub-buttons (with cities) will show up to player + I wanted to add scroll option to those sub-buttons if there will be more then 4 cities.

Yet no matter what I try it always end up: not showing at all or showing at the same place as other buttons (countries). Here is img of how it should work:

How it looks in godot ( I just make anything to show how my gui is set-upped

Thanks for anyone who would take their time to solve my problem!!!

A VBoxContainer arranges its children in tree order. So, you should put the sub-buttons in separate ScrollContainers right under the button that displays them. Additionally, containers try to shrink their children by default, so you will need to set a minimum size for the sub-button container.

Thanks!!! Acually I wrote it more then 4h ago (idk why it show 1h) and I manage to somehow solve it just 40 min ago by setting minimal size (didn’t know about it before). Still thanks a lot for replay

1 Like