OpenFL HTML5 Target overly zoomed/scaled on High-DPI devices

I’m working on a dialogue editor using the openfl backend and when I target html5, the UI is very zoomed in on high DPI devices ( ie: surface pro ):

normal:

DPR 2 or 3:

I’ve tried manually setting the toolkit scale using:

haxe.ui.Toolkit.scaleX = 1.0;
haxe.ui.Toolkit.scaleY = 1.0;

editing the project.xml to allow and reject high dpi but to no avail, so I was wondering if anybody has encountered this kind of issue before.

editor online here, if you inspect element and change the dpr to either 2 or 3 and refresh you should see the issue.
source here

Thanks!

Is there are Toolkit.scale that works? usually haxeui tries to detect hdpi displays, but maybe on openfl that isnt working so well.

1 Like

So if I apply ie: toolkit.scale = 2 with DPR 1 I get the following ( app only takes up a portion of the screen but its UI elements stay the correct size ):

however with DPR 2 or 3 it has the same issue UI component scaling issue however it does take up the full screen

Hello!
Actually forcing Toolkit.scale to 1 for JS did indeed fix the issue, just needed to add it earlier in my main.hx, thank you.