Changing resolution without changing camera view

Godot Version

4.3

Question

Simple question, really: I want the player to be able to change the game’s resolution

I know vaguely how to do that in code, but that’s not what I’m here about. I’m asking about keeping what the player sees in-game the same, regardless of resolution.

The stretch mode is set to viewport, and the Aspect is at Keep. This works fine if I’m always playing the game at, say, 1280x720, I can resize the game window and it won’t mess anything up.

However, once i change the resolution in Project Settings(and I reckon if it changes in code), The in-game camera also seems to increase and decrease in size, showing more or less to the player than I intended.

Am I stuck with this, is there a good solution, what’s the best course of action?

Set the stretch mode to canvas_items, now the cameras zoom stays always the same no matter the resolution.
Play around with the aspekt settings until you find what you like (just resize your window on runtime via your cursor, keep the strech mode to canvas_items)

1 Like

Judging by your clarifications regarding the game resolution of 720p and its change, say to 1080p, it turns out that all sprites and objects visually decrease or increase depending on the change in resolution…

And you are looking for a way to always have sprites and others object the same SIZE on any screen, at any resolution. Did I understand the question correctly?
Let me know - If SO, thats is NOT so simple question like it seems, but I have a solution :smiling_face_with_tear: