Hi,

I know you can manually change the node size like a textureRect or sprite, with a resize signal, but, I would expect that this would happen automatically, for instance, when I expand the window of the app to maximize it, as you maximize every window in windows, by clicking the button on the up right area of the window, the app nodes do not expand to fill the whole window space, I find it hard to believe I have to connect each node to a resize signal manually, there must be some container that everything can be a child of, and is doing it automatically, or at least, you only have to make a resize function for that container, and the child nodes are resizing by themselves.

Saw the link, was very helpful ... but...

As mentioned in this article - the main problem of stretching is with 2D Nodes, the 3D Nodes don't need to be stretched, they have to be resized, but no stretching has to be done, as they depend on the camera field of view, which is scaling them to fit the same size.

but... in my case there is a problem

I have a scene which is covered by a TextureRect. I render my 3D scene into this TextureRect, so my 3D final result is rendered into a 2D object, and stretching it, is distorting the smoothness of my rendering -- everything I have achieved by using MSAA is lost by this stretch.

So I ended up using the resize signal on the UI node which is a control type node and all UI components are it's children - like this:

func _on_root_resize():
	ui_node.rect_size =  get_tree().root.size;

And it re-positioned the components according to the new viewport size, but it didn't stretch/scale them, which is fine with me, I don't need the button to be twice the size, just have it stick to the bottom where I've put it.

Which brings up another question: By default Godot is not doing any stretching, unless you set it in the project settings, but does it keep the game in it's original size even in a very high resolution screen? What if I run the game on a very high resolution screen, but a small screen (like the ones you can find on some mobile devices), and the game size is 240x320 pixels, will it be too small to see the buttons, or will Godot keep it's original size in inches, regardless of the resolution of the screen, even if stretch is disabled on the project settings?

On my screen, no matter the resolution I set, the Godot game stays the same size more or less, but maybe changing the screen resolution of a screen is not the same as running the game on a different screen with a higher resolution.

That is still kind of related to and dependent on the stretch-mode to an extent. For individual 2D nodes though, you'd also have to make sure to set up their anchoring properly and the node size flags. Also making use of the right containers and the node order & hierarchy.

https://docs.godotengine.org/en/3.1/tutorials/gui/size_and_anchors.html https://docs.godotengine.org/en/3.1/tutorials/gui/gui_containers.html

This is something that will just require a little more experience with godot, but you will definitely figure it out, it's not actually hard, just takes a bit of time to accumulate the experience with it. Essentially GUI design is an architectural thing, once you have enough experience with the nodes and the relevant properties you will be able to plan your gui design and architecture out before you implement it, which will make things easier.

This page from the documentation on handling multiple resolutions might also be helpful to look at. It explains how Godot handles resizing the main Godot window.

3 years later