- Edited
I want to add my scene into a Gridcontainer but it seems the grid "thinks" the size of the scene is smaller than it is.
As you can see the buttons are ligned up correctly, but the MyControl scene instances overlap:
Here the godot 4 project:
I want to add my scene into a Gridcontainer but it seems the grid "thinks" the size of the scene is smaller than it is.
As you can see the buttons are ligned up correctly, but the MyControl scene instances overlap:
Here the godot 4 project:
ando Welcome to the containers hell
You may have to set "custom minimum size" property in each sub-scenes, you could also add a ColorRect control with alpha set to zero using the size you want (or an invisible TextureRect with a picture of the right size).
It may not be the best practice at all and I'm still waiting to get some good tutorials & docs about "new", I guess, way to deal with them in Godot 4.
AFAIU(nderstand), container automatically deal with their content recursively ONLY if at each end, each containing item define its own size, controls into controls into controls does not do that for us and create such overlapping issue.
It may also be needed to define proper anchors or layouts for each item from bottom to top.
A good video to watch: from GDQuest with 3.5, still useful. There is also their other video with GridContainer in the same playlist.
Hope this help.