Skip to main content
edited tags
Link
DMGregory
  • 140.8k
  • 23
  • 257
  • 401
Became Hot Network Question
Source Link
Jeroen
  • 695
  • 7
  • 20

What's the difference between VBoxContainer and VFlowContainer?

I'm trying to build some UI for my game made in Godot 4.0. I want to make a "Toolbox" scene and need to decide what containers to use. I come from web development, where I'd use a flex column and each tool would be a single row in that column of items.

In Godot 4 I have many options, the two relevant ones are nearly indistinguishable:

  • VBoxContainer
    • UI Description is "Vertical box container."
    • Official docs only say "Vertical box container" and tell me it has a separation property.
  • VFlowContainer
    • UI Description is "Vertical flow container."
    • Official docs say "Vertical flow container." and tell me it has both a h_separation and v_separation property

The control tree in the Godot UI has some hints. The icon for VBoxContainer suggests it's what I want, but then again it lists a ColorPicker as a child of that type of node so that throws me off again.

What's the difference between these two controls, and when would I use one over the other?