macroquad icon indicating copy to clipboard operation
macroquad copied to clipboard

How to get size of screen

Open BennettB123 opened this issue 2 years ago • 3 comments

Is there a way to get the user's screen size in pixels? This would be helpful in situations where full-screen mode is not wanted but we still want to set reasonable default window sizes that will work for most screens.

For more context, this request comes from working on a project across 2 different laptops with very different screen resolutions. In order for the macroquad window to "fit" on both screens, I'd have to manually change the default window size every time I switched devices.

BennettB123 avatar Sep 03 '23 22:09 BennettB123

I do not think this is currently implemented :(

not-fl3 avatar Sep 04 '23 00:09 not-fl3

Any idea how feasible this would be to add? I'm a rust beginner, but if this feature isn't too difficult I wouldn't mind spending some time trying to implement it.

I'm also curious if something like this would even be helpful for the community. I was surprised to not find any other issues/requests for such a feature.

BennettB123 avatar Sep 05 '23 23:09 BennettB123

Might be worth noting that screen size is probably easy to get. Where it gets a little complicated is if end users are using OS-managed HiDPI scaling, where if their scale is set to something like 2.0 (or 200%) to have 1920x1080p upscale to 3840x2160, what should the API return?

djtuBIG-MaliceX avatar Mar 10 '25 05:03 djtuBIG-MaliceX