I am currently working on a game in Rust (Piston Crate) and I want to center the Window it creates. It allows me to change the window's offset from the top left of the screen. I want to get the resolution the operating system works in (screen / display / monitor resolution) and center the window based on that.
In Python for example, by using pyautogui
, you can get the screen resolution using pyautogui.size()
.
In Java, by using java.awt
, you can get the screen resolution using Toolkit.getDefaultToolkit().getScreenSize()
.
Is there something similar in Rust I could use? (std
- or any extern crate)