Can I create a component that controls the layout of its children?

Godot Version

4.2.1

Question

I’m trying to create a fold out panel control. The idea is that if you click on the header of the control, it will toggle the visibility of the body area.

I’m trying to figure out how to add children to my control. If I click on Editable Children, I can make the content area of my panel contain the right child controls by just making them children of the ContentArea control. But is there a way to do this without using EditableChildren?

Ideally, I’d like to just drop my child control onto my FoldOutPanel without having to check EditableChildren first and have it automatically arrange all the children in the ContentArea. If I do that with the current control, the child control is laid out so it fills the entire FoldOutPanel control’s space.

It’s not supported yet. There’s a proposal with a draft PR open here Allow user to expose nodes within an instantiated scene instead of just "Editable Children" · Issue #8266 · godotengine/godot-proposals · GitHub

1 Like