I have been attempting to achieve window resizing maintaining a constant aspect ratio in code and have also tried in the IDE. The window contents do not quite track the window. Is there a correct way to achieve accurate tracking?
Thank you.
I am not sure this is a good idea unless you are doing something very special. It could be very annoying for users if you try to limit their control on window aspect ratio. It might even be impossible given the way windows work at least on a PC.
If you want to control the position of UI elements, control nodes and canvas layers are what you should use. They are very powerful but there is a learning curve on getting your head around how they work. Once you get the gist, they are amazing!
If it is because of some game limitations in your environments or worlds etc, you should pad out the empty space with something relevant (some use clouds, or starry space backgrounds, or walls or bricks etc.
Perhaps we could help more if we knew the problem you were trying to solve with a forced aspect ratio on a window.
PS I suppose your other choice would be to not have the window resizable at all. You can find this in the project settings. But again this could be annoying to many users.