Open Mintonist opened 10 months ago
I guess it's because it requested high-resolution settings… I remembered that i faced the same problem?
There is a property provided by AIR 50.0 that can help you calculate the scaled area, see: https://airsdk.dev/reference/actionscript/3.0/flash/display/Screen.html#contentsScaleFactor .I think i should have solved it this way…
@xiaoChi888 thanks! Ican do it, but there were no problem early (before WebView2), so @ajwfrost has said that they were investigating the possible issue.
Have a look here: https://github.com/airsdk/Adobe-Runtime-Support/issues/1784#issuecomment-1072373640
You need to consider stage.contentsScaleFactor
when applying the viewport
.
Thanks! I know about it. But how we can know what version of WebView we use at runtime (old or new)? So I think viewport must work the same way in both cases.
Not sure if this is the best approach but you could access the app-descriptor.xml
from you app and check for
<windows>
<UseWebView2>true</UseWebView2>
</windows>
which will indicate that you are using the "new" webview.
Something like:
var appXML : XML = NativeApplication.nativeApplication.applicationDescriptor;
var ns : Namespace = appXML.namespace();
var windowsTag : XMLList = appXML.ns::windows;
var isWebView2 : Boolean = XML(windowsTag).children()[0] == "true";
trace("isWebView2 " + isWebView2);
But now it can be old WebView even if descriptor has <UseWebView2>true</UseWebView2>
(for example Edge WebView2 has been removed or never installed)
Hi! Previously I used ANE NativeWebView or old AIR StageWebView for my game in payment process. I set viewPort like this:
stageWebView.viewPort = new Rectangle(deltaX, deltaY, Starling.nativeStage.stageWidth-2*deltaX, Starling.nativeStage.stageHeight-2*deltaY);
And there were no problems with any Windows display zoom:
But with WebView2 on PC with 150% zoom it looks:
Starling.supportBrowserZoom and Starling.supportHighResolutions
are true.descriptor settings:
Is it a AIR bug or I need to count zoom myself?