Any insight on this will be really appreciated :)
Thanks for the quick response Bruno :)
It doesn't seem to be WebGL related as we're testing this on an Android chrome browser, which as far as I know has no webgl support.
Comparing Flambe's and openfl's index.html files there seem to be a couple of major differences that are related:
https://gist.github.com/ehudros/e29644cfe5e58b13c04a (openfl index.html)
https://gist.github.com/ehudros/97de49ac139aa7e8683f (flambe html)
The main difference is that openfl sets the viewport inital-scale to 0.66 and has the canvas set 1280x720 (which is what we are designing for).
Flambe keeps the scale at 1 and sets the canvas to the native viewport size of 598x287 (this is a Nexus 5 device).
Our desired result would be to get crisp images on high res devices, which currently doesn't seem to work out of the box for us.
Here are two screenshots taken from the device:
http://imgur.com/a/qIOJu
I am almost entirely sure this behavior is either by design or we are missing a basic concept regarding html5 development, so any insights will be highly appreciated.
System.stage.resize.connect(onResize);Consts.WIDTH = 1280; // our target widthConsts.HEIGHT = 720; // our target heightprivate static function onResize():Void{
// not 100% sure this is required...
htmlStage._canvas.style.marginLeft = ((originalWidth - (Consts.WIDTH * scaleFactor)) / 2) + "px"; htmlStage._canvas.style.marginTop = ((originalHeight - (Consts.HEIGHT * scaleFactor)) / 2) + "px";
Lastly, the following javascript code is needed in index.html:}
<script>window.addEventListener ("touchmove", function (event) { event.preventDefault (); }, false);
if (typeof window.devicePixelRatio != 'undefined' && window.devicePixelRatio > 2) {
var meta = document.getElementById ("viewport");meta.setAttribute ('content', 'width=device-width, initial-scale=' + (2 / window.devicePixelRatio) + ', user-scalable=no');
}</script>
I was facing the same issue, especially on mobile.
How are you accessing _canvas as it is a private variable in HtmlStage?
Thanks