How do I set the resolution for my 2D pixel art game?

Godot Version

4.4

Question

Hi! I’m making a 2D pixel art game. I’ve already finished the mechanics and saved the visuals for last; now I need to configure the internal resolution and related settings.

I was planning to use an internal resolution of 320x180 or 640x360 so it scales smoothly to Full HD or 4K.
Initially, I tested:
320x180 (and also 640x360)
Mode: Fullscreen
-Stretch:
Mode: Viewport
Aspect: Keep
Scale mode: Integer.

The first issue was that black bars appeared at the top and sides. I later discovered that if I set the mode to “Exclusive fullscreen,” the black bars disappear. They also go away if I use “fractional” scaling instead of “integer.”

However, I’m not sure which configuration is best. I’ve read that “fractional” scaling isn’t recommended for pixel-perfect visuals. As for “fullscreen” versus “exclusive fullscreen,” I’m unsure of the advantages or disadvantages of each.

How would you recommend I configure the display?

Integer scaling ensures pixels are not stretched and look good. You could add fractional/integer scaling mode as an option for your game, allowing players to remove the black bars if desired. I’d recommend using integer scaling as the default.

You can read more about this in the docs, including why to use exclusive fullscreen on Windows.

There are basically four options:

  • Only support window sizes and screen resolutions that are a multiple of your base resolution. (This means that your game cannot run full-screen at all on some computers.)
  • Fractional scaling.
  • Black bars.
  • True dynamic resolution support, i.e. show more of the game world if the window is bigger.

Which one you want to pick is ultimately a question of personal preference. However, my personal preference is that I’d much rather have black bars than fractional scaling.