Hi guys, I would like to ask some help in determining what tree hierarchy I need. The image shows what I would like to achieve:

  • A ScrollContainer of fixed size, because it should be one certain part of the screen
  • A VBoxContainer inside that, which grows along with its children. If it gets larger than the parent ScrollContainer, you can scroll to see the entire VBoxContainer
  • Inside the VBoxContainer are the level 1 buttons.
  • Clicking a level 1 button, should display its sub-buttons, and the second level 1 button should move below that.

The tree then looks like this:

The elements are marked with corresponding colours as picture 1. The logic works if there is only one level 1 button: If I click the button, I create the same system of "ScrollContainer > VBoxContainer > Buttons" inside the Playlists node.

However, I can't figure out what type the Playlist nodes should be. After trying many types, I get one of following results: - The two level 1 buttons are on top of each other - The two level 1 buttons are organised one below the other, but the second button doesn't shift downwards after opening the first list of sub-buttons - The two level 1 buttons are organised one below the other, but the sub-buttons are displayed inside the first level 1 button - The two level 1 buttons are organised one below the other, but the ScrollContainer created for the sub-buttons has 0 height, so nothing appears

I hope someone can provide some tips!

3 months later

If you simply want to switch between showing and hiding, you can do so by combining VBoxContainer.

By switching the display state of the child elements in the VBoxContainer, GodotEngine will automatically resize the VBoxContainer.

This method is easy to use, but if you want the child elements to slide while animating when the button is pressed, it will take more time.

10 days later

Hi, thanks for answering! I did not know this, very useful! In the meantime I had solved it by changing the layout and therefore avoiding this. But I can imagine how this would work for my case

a year later