Cannot get Screen Size through script

Godot Version



I want to get the size of the screen through script to get my relative position of my window on the screen. But for some reason, I cannot find any references to a code snippet to get the screen size, except OS.get_screen_size() which doesn’t seem to work in the current version of Godot.

Try DisplayServer.screen_get_size(), see DisplayServer — Godot Engine (stable) documentation in English

Works perfectly! Thank You!!!

1 Like