When should we use a PanelContainer and when not?


I don't know what is the criteria to add a PanelContainer as the main node of the scene. In this exercise for example, would it be well done to create a PanelContainer and the HBox as its child?

Thank you in advance!

  • Nathan Lovato replied

    A panel container will automatically resize its children to fit the panel. A plain panel node will not, by default. So you can almost always use one or the other in a given setting, you will just have to create the child nodes a bit differently depending on the interface you want to make.

    It's hard to give you much more than that at this point because we've not given you an in-depth run through Ui creation in Godot. There is quite a bit to say about the UI system: it's pretty flexible as it's designed to make interfaces as complex as the Godot editor itself. So often you can achieve the same result in quite a few different ways.

  • ploped00 replied

    Hi Nathan,

    Perfectly explained. Do you know about some tutorial to develop UIs?

    Thank you again for all your good work.

  • Nathan Lovato replied

    Unfortunately no, I don't know a great one. We meant to create one, and I had hired someone to work at least on an introduction guide, but that person has since switched careers.

    Unfortunately, we struggle to find excellent tutors, especially persons who love serving students enough to stick around and do the important work of planning and writing lessons. Even with good pay, it's hard work, and lots of people, unfortunately, quit to work on games or something else.