Orthographic Zoom on High DPI screens

Hey there,

So I’ve been using the orthographic camera with FIXED_ZOOM, and everything works ok – but I noticed that if I launch the game on a high-DPI screen (like a retina macbook) then the zoom won’t be correct (it will be precisely half what it should be). The High DPI setting is clicked in the game settings but that doesn’t really seem to have an impact.

Any thoughts on this one? Is this a case where you have to manually double the zoom on these types of screens?

Thanks!

What you want to do is to use camera.set_window_scaling_factor(scaling_factor) based on what kind of screen you are using. If it is a retina screen the scaling factor should be 2 I think.

You can use DefOS to query the screen and get the scaling factor.

Awesome – that worked perfectly. Handy to know about the DefOS library. Thanks!

1 Like