+1 vote

Hello, I was making a prototype and i wanted to setup my resolutions ahead properyl.

To give context...

I read Multiple resolutions doc and followed gdquest tutorial on resolution settings, I'm making all the assets in 4k to support it, so by design is 4k.

My project configuration window looks like this:

Width = 3840
Height = 2160
Test Width = 1280
Test Height = 720
Resizable = on
Stretch Mode = 2d
Stretch Aspect = keep
Stretch Shrink = 1

If I run the game, the debug window (with the test size) works like a charm if I resize it, all shrinks correctly:

Initial resolution
https://imgur.com/PSjEaSu

Resizing window
https://imgur.com/qpsPF2B

Then, when I manually change the resolution in code, this happens:

Chaging resolution by code:
https://imgur.com/UQQQ9hi

https://imgur.com/tKQqbVz

It is like instead of scaling to the new smaller resolution, is croping the excess pixels and doing a zoom.... I cannot wrap my head around this.

The code for changing the resolution:

func update_settings(settings: Dictionary) -> void:
get_tree().set_screen_stretch(
    SceneTree.STRETCH_MODE_2D, SceneTree.STRETCH_ASPECT_KEEP, settings.resolution
)

OS.set_window_size(settings.resolution)

It has the same stretch modes as configured in project settings...

I also tried changing it simply by

    OS.set_window_size(settings.resolution)

and not setting the stretch modes. This seems to be working as intendeed(not doing zoom and scaling) but it creates weird artifacts when fullscreen:

https://imgur.com/IjjhLZq

All this this are happening in the editor, in the debug executable for windows and in the release executable for windows.

Any ideas on how to solve this?

Godot version 3.4.3
in Engine by (13 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.