I'm trying to change the resolution for a flex native app (air) app running on a retina macbook. Flex apps in the browser render everything smoothly at 160dpi automatically but if I build the same app as Air install app, it renders at 72dpi and doesn't look as good. I know you can set a resolution in the application descriptor file for a mobile app but this isn't one. Also, I've tried setting the applicationDPI property on the WindowedApplication tag as well with no luck. Any ideas? Thanks...
2 Answers
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" width="1019" height="680" scaleX="0.8" scaleY="0.8" applicationComplete="init()" ...>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" width="1019" height="680" preinitialize="initScreenSize()" applicationComplete="init()" ...> ... ... private function initScreenSize():void{ var thisScreen:Screen = Screen.mainScreen; var newScaleX:Number = thisScreen.visibleBounds.width / 1019 * 0.98; var newScaleY:Number = thisScreen.visibleBounds.height / 680 * 0.98; var newScale:Number = Math.min(newScaleX,newScaleY,1); this.scaleX = newScale; this.scaleY = newScale; this.height = this.height * newScale; this.width = this.width * newScale; }
to scale the app based on the user’s resolution. Here’s the code: