0 votes

I have a scene (ItemBag) for a widget to reuse often that has a PanelContainer (search_out). The scene tree looks like this:
ItemBag's scene tree: the scene to instantiate
And in another scene (GUI) I'd like *ItemBag* instances to behave like a Container:
in the Scene Tree panel each child of *ItemBag* would end up in the PanelContainer search_out, like *Label* in the screenshot below.
Ideally the GUI Scene Tree panel would only look like this:
GUI's scene tree: the scene using several ItemBags

Of course I can enable Editable Children to each ItemBag, but that clutters the Scene Tree panel very much and visually identifying modifications of the instance remains hard.

I am thinking about using @export_node_path(Control) in ItemBag' script to move Label in _ready() but that is not scalable and looks convoluted..

How would you deal with such a situation with re-usability in mind?

Godot version Godot4.0
in Engine by (18 points)
edited by

success with this approach:

  1. a proxy Container, parent of ItemBag which handles the layout.
  2. a proxy Control, child of search_out, for each external child.

A component version is in the works that will leave ItemBag instances free for a custom script.

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.