How do you get the computer display resolution?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By ClumsyDog

I’d like to know the player’s computer display resolution. Not the game window resolution, or the game window size, but the player’s computer display resolution. That’s it. Thanks!

:bust_in_silhouette: Reply From: kylemcclinton

OS.get_screen_size() should get you what you want.

Oh, thanks! That seems correct… well, it should be, anyway. My computer’s resolution is 1920 x 1080, but for some reason it’s printing 1536 x 864. Huh.

ClumsyDog | 2021-03-15 05:33

Are you using hiDPI scaling on WIndows? If so, the returned result may be scaled down to represent the actually usable screen real estate.

Calinou | 2021-03-15 13:25

In Godot 4: DisplayServer — Godot Engine (stable) documentation in English

blockchan | 2023-04-27 10:55