Open XANOZOID opened 6 years ago
Implemented a fix for now :), definitely does the job!
http://monkeycoder.co.nz/forums/topic/dpi-for-android/
@blitz-research do you think this is something which should be added to the Monkey2 source code for the time being?
What is it used for?
On Thu, Jan 11, 2018 at 11:43 AM, Abrahim notifications@github.com wrote:
Implemented a fix for now :), definitely does the job!
http://monkeycoder.co.nz/forums/topic/dpi-for-android/
@blitz-research https://github.com/blitz-research do you think this is something which should be added to the Monkey2 source code for the time being?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/blitz-research/monkey2/issues/319#issuecomment-356762473, or mute the thread https://github.com/notifications/unsubscribe-auth/ADU3Ql5DJOFkteADPX1s9hvMGyz1hKL1ks5tJT0mgaJpZM4RZw7P .
It is to make sure sizes are, ftmp, pixel(Dots*) density independent.
Problem: Screens of the same size can have different pixel(Dot*) densities which makes pixels an impractical form of measurement - especially for UI.
Solution: DPI allows us to make sure the sizes we are using is consistent across screens in terms of "inches" . . .
Unfortunately, there are no metric versions of this function.
It would be great to have a dpi value! especially on mobiles where the screen size may vary from 3 to 10" for almost the same resolution.
Any chance you can cpome up with something for other targets too? And in particular, the 'dpi/mouse scale', ie: 1 or 2 etc.
I kind of want:
GetDpi (dots per inch) GetDpiScale (OS dpi scale factor for screen coords eg: for window sizes/mouse coords).
Especially on macos, as the current solution involves creating a window, checking dpi, then resizing/repositioning window if it's high dpi. I'ts horribly ugly, and If I know 'dpi scale' before hane I could clean this up!
On Fri, Jan 12, 2018 at 12:59 AM, abakobo notifications@github.com wrote:
It would be great to have a dpi value! especially on mobiles where the screen size may vary from 3 to 10" for almost the same resolution.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/blitz-research/monkey2/issues/319#issuecomment-356914008, or mute the thread https://github.com/notifications/unsubscribe-auth/ADU3QjwQIllFpbwKzbKfVNjSLmVogp6mks5tJfecgaJpZM4RZw7P .
@blitz-research I currently have my own module I've derived from my work from above that's more consistent and platform independent. . . All it does is use the SDL feature and if that fails fallback to a native attempt - does this look okay? I'm not sure about the DPIScale feature you're talking about
The code is able to do this:
As such:
Local DPI:=New Vec2i( DisplayUtility.GetDPI( True ),DisplayUtility.GetDPI( False ) )
On second thought it might make the most sense to return a vec3 for this function ...
I think the patch should already be in one of the newer version of SDL2, but as of right now we do not have access to this functionality ...
https://stackoverflow.com/questions/46987812/sdl-getdisplaydpi-doesnt-work-on-android
I don't know how to work with JNI but I will be trying to figure it in the meantime while I have time