bryanedds / Nu

Repository hosting the open-source Nu Game Engine and related projects.
MIT License
1.12k stars 156 forks source link

Make Gaia ignore Windows DPI #762

Closed CarlosLeyvaAyala closed 6 months ago

CarlosLeyvaAyala commented 6 months ago

Right now, Gaia size changes when using Windows zoom to anything other than 100%. For example, setting Windows zoom to 200% makes it unusable.

bryanedds commented 6 months ago

As a workaround for this in latest, you can add this to the editor's App.config file to change the engine's output resolution -

    <add key="VirtualResolution" value="[640 360]" />

This should make the editor window the exact size of your screen. You might need to set the Windows Task Bar to Auto-Hide if it's in the way tho.

The trade-off here is that you'll be using something other than Nu's current standard virtual resolution. Tho now that I think about it, this is a common factor of all of 1080, 1440, and 4k resolutions... so maybe this ought to become the standard resolution instead...

bryanedds commented 6 months ago

Okay, I've gone even further to fix your problem more directly.

All you need to do now is just use this line to your App.config -

    <add key="VirtualScalar" value="2" />

You won't even need the line of code in the previous comment because it's that by default now.

Make sure you have the latest code from master since it has the related fixes.

Let me know how this works for you!

bryanedds commented 6 months ago

Will go ahead and close this because I think what we've provided is a solution to the problem underlying problem. Would be nice if SDL provided this functionality for us tho (I think it will in SDL3 directly, tho).

CarlosLeyvaAyala commented 6 months ago

Thanks!

Sorry for my late answer.

Yes it works. I have to change VirtualScalar in both Gaia and my project settings, but it totally works.