How do i get the available resolution of the device the program is running on?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By zyrixian
:warning: Old Version Published before Godot 3 was released.

Hi,

I’m looking to resize the viewport area based on the size of the screen of the device the program is running on. I know how to get & set the viewport size, but not the device screen resolution. How would one do that?

Also, how would you set the position of the window (for win/mac/linux)?

Thanks!

:bust_in_silhouette: Reply From: user41420082

For getting the resolution that would be OS.get_screen_size(). For setting the position, it would be OS.set_window_position().