I’m taking baby steps into Amethyst at the moment and thought I’d make a very simple “game”; a loading screen displaying a logo.
So I read through the Book and managed to create a window and transition into a
LoadingState, which (
on_start) reads a texture to a sprite and displays it using a 2D Camera. So far so good.
Now I have a high resolution/high DPI laptop screen which is quite small so Windows suggests scaling all UI and apps to 250%, which works well in general, but the Amethyst game window gets scaled as well. So the window and all my sprites in it are scaled up 2,5 times so the logo gets unsharp and blurry.
I found a section on DPI in the Amethyst documentation and it mentions you can get the DPI from the active monitor/window, but I can’t seem to find any actual examples on how to do this.
What I’d like to do is to get the DPI from the active monitor in my
main.rs, before creating any window, so I can take the DPI into account already for the window size and then in all (upcoming) states where I draw something I’d also listen to the DPI change event and adjust accordingly.
RenderingBundle and plugin
RenderToWindow::from_config(display_config) and have not found any way of getting the DPI out from that flow. Maybe I have to create the window in a different way to get the DPI?
Would be glad if someone could point me in the right direction. Thanks!