Editing Black Boxes Created on Project Run

Godot Version

4.4

Question

Hi for my project I have the window stretch mode set to viewport and the stretch aspect to keep. This obviously works as expected and the original window is scaled as much as possible then black boxes are added when it runs at various resolutions. However, I was wondering if (and I know this is a weird thing to want to do) if the black boxes could be set to be images or other solid colors? Because my game would look a lot better if I could set them to appear diffrent. I know there were ways to do this in prior versions but I am unsure if such methods still exist in 4.4.
Thanks!

This used to be a feature in Godot 3, see:

But starting with Godot 4, you have to implement this yourself. The easiest would be to let the images stretch, and through code, keep the “actual” content of your game within a small box inside the game window, and render your custom image around it. Essentially, you wouldn’t rely on the built-in scaling, but rather, implement your own. It shoulnd’t be too difficult.

1 Like