Resizing problem

Godot Version

Godot v4.6

Question

Hello. I am relatively new to the world of game making. I started thinking about learning some month ago and I finally gathered the courage to learn two weeks ago. I have an extremely basic knowledge of the logic of coding because of the game “the farmer was replaced on steam“. Thus, I started the creation of an idle game because I figured it would be the “easiest“ game to make (I think I can manage it with only ui element without even touching to 2d or 3d nodes or worst, physics.) I take it one step at a time to learn how each element work and after some searching I am beginning to grasp the bases needed for what I need.

Starting yesterday, after learning said bases I started to work a bit more concretely on the game, starting to place the ui where I want to have something a bit cleaner than just random scene used as test.

My idea was to have a main scene where I would put a tab container, it would permit me to switch to different tabs to access different scene that contains upgrades, information, etc. I started to design one of those scenes and then added it to a tab in the main scene when…

It went from this clean window to:

The children of my container did not resize. I did know that a tab container reduce the size available. I pass from a full screen to less because the little clickable tabs need to be seen.

Preparing for that, I checked the container sizing of each clickable button inside the grid hoping the size of the button would not be maintained once the scene resize to the tab container which evidently… did not work.

Or maybe the button WILL resize but the grid itself do not which in the end give the same result. I looked at it but I do not seem to have the same “container sizing“ option in the inpector of the grid node.

I would like to know what I could do to resize them properly. I imagine that if I have this problem with 1 scene it will surely happen with other and I can’t seem to find anything only on this particular matter (or perhaps am I not searching properly). Sorry for the lenght of this whole post but I wanted to make sure my level is understood, if my only option to do that is via code I can feel a big headache coming because I have nowhere near the skills to do that just yet and simply copy pasting seems a bit pointless when my goal making this game is to understand how the engine function.

Thanks in advance for anyone who took the time to read and perhaps even answer.
Much love to everyone here, the realm of game making always seemed to me like such a big mountain to climb <3
If any more explanation or screenshot are needed I would be happy to provide more context.

Control nodes will resize automatically, but only if you are using anchors or containers. The default Control node is not a container, so it will not automatically resize to fit its children. In this case, “Buildings” appears to be a normal Control node that doesn’t care about how big its children are.

Thanks for the answer! Thought it seems a bit weird to me, I was able to fix it by adding more control node to anchor some things in place, for example by anchoring my grid to it. Now, the tab work as intended and stay in the boundary. I’m not sure I fully understand why is that but I guess I’m gonna apply the concept of “if it work don’t touch it“ I’ll see if I can do the same with other tab I might create but for now it’s a headache gone (or maybe just put away waiting to ressurface HAHAHA)

1 Like