lime.system.Display dpi property is not accurate on Android

I’m accessing it like this:

System.getDisplay(0).dpi;

Specifically, the dpi is returned as 72, despite the phone I’m testing on having a dpi of 518. This is an issue, because on high-dpi displays the assets of my game are way too small, so it is necessary to take dpi into account as well as scaling to the full screen size.

Is there a workaround to this issue? Or am I simply getting the dpi in the wrong way?

Yeah, i have the same issue. Which is an issue for sure. As a temp work around i have an openfl extension that gets the DPI from the device (rather than via SDL), buts its not a pretty solution and its no ideal either.

Are there any plans on getting DPI working in either lime and/or openfl? Its quite important imo.

Cheers,
Ian

Fixed in latest Lime release :slight_smile:

1 Like

Yep, as of Lime 3.7.2 lime.system.Display returns accurate dpi. Thanks for continuing to make OpenFL and Lime great! :slight_smile:

1 Like

Oh! Fantastic! Thanks Josh… this is a big deal… Everything is in place for haxeui2 mobile theme, but ive been holding off as the scale has to be hardcoded because of this issue…

thanks!

1 Like