Get the screen DPI/PPI
Posted: Tue Jul 27, 2021 8:05 am
Hello,
In my game development, I need to get the correspondance between one true unit screen distance (e.g. 1 inch or 1 centimeter)
and the number of pixels associated with this distance. This is because I need to zoom in/out some objects (images) but I
want them to be still visible.
There is the function love.windows.getDPIScale(), but it does not return what I want.
Is there anyway from love to get the DPI screen value ?
Actually, it would be cleaner to talk about the PPI (Pixel Per Inch).
Regards
EDIT :
I guess my question is a bit out of love scope.
I am not sure the DPI/PPI is accessible in windows, but at least one can calculate it with the screen dimension, e.g. 1600x1200 pixels,
and the screen diagonal, expressed as 13", 24", ...
So the more precise question would be : is it possible to retrieve the screen diagonal from love ?
In my game development, I need to get the correspondance between one true unit screen distance (e.g. 1 inch or 1 centimeter)
and the number of pixels associated with this distance. This is because I need to zoom in/out some objects (images) but I
want them to be still visible.
There is the function love.windows.getDPIScale(), but it does not return what I want.
Is there anyway from love to get the DPI screen value ?
Actually, it would be cleaner to talk about the PPI (Pixel Per Inch).
Regards
EDIT :
I guess my question is a bit out of love scope.
I am not sure the DPI/PPI is accessible in windows, but at least one can calculate it with the screen dimension, e.g. 1600x1200 pixels,
and the screen diagonal, expressed as 13", 24", ...
So the more precise question would be : is it possible to retrieve the screen diagonal from love ?