Highlighted

Scaling an Adobe AIR application to fit multiple resolution devices

Explorer ,
Oct 23, 2016

Copy link to clipboard

Copied

Hi,

I have another problem. Right now I'm trying to provide multiple resolutions in flex-spark air mobile app.

Application is based on ViewNavigation and has many views triggered via .pushView() method.   Each view has own skins with custom backgrounds, etc..

There are many elements on each view, so I decided that I will recognize view as HD canvas 1080x1920.  Moment ago I've checked that there are many problems with different devices - many resolutions and DPIs.

In my ViewNavigatorApplication I wrote method:

  protected function preinitialize():void {

       this.scaleX = systemManager.stage.stageWidth/1080;

       this.scaleY = systemManager.stage.stageHeight/1920;

  }

and also removed "applicationDPI" definition.

Almost works...    On each view it works but problem exists during transitions between views.  I've seen fragment (about 1/4) upper left part of screen with animation.

Any idea how to solve it or other nice method for proper scaling?

Best regards,

Piotr

Solved.  Assigning dimension works.

  protected function preinitialize():void {

       this.width = 1080;

       this.height = 1920;

       this.scaleX = systemManager.stage.stageWidth / 1080;

       this.scaleY = systemManager.stage.stageHeight / 1920;

  }

TOPICS
Development

Views

473

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Scaling an Adobe AIR application to fit multiple resolution devices

Explorer ,
Oct 23, 2016

Copy link to clipboard

Copied

Hi,

I have another problem. Right now I'm trying to provide multiple resolutions in flex-spark air mobile app.

Application is based on ViewNavigation and has many views triggered via .pushView() method.   Each view has own skins with custom backgrounds, etc..

There are many elements on each view, so I decided that I will recognize view as HD canvas 1080x1920.  Moment ago I've checked that there are many problems with different devices - many resolutions and DPIs.

In my ViewNavigatorApplication I wrote method:

  protected function preinitialize():void {

       this.scaleX = systemManager.stage.stageWidth/1080;

       this.scaleY = systemManager.stage.stageHeight/1920;

  }

and also removed "applicationDPI" definition.

Almost works...    On each view it works but problem exists during transitions between views.  I've seen fragment (about 1/4) upper left part of screen with animation.

Any idea how to solve it or other nice method for proper scaling?

Best regards,

Piotr

Solved.  Assigning dimension works.

  protected function preinitialize():void {

       this.width = 1080;

       this.height = 1920;

       this.scaleX = systemManager.stage.stageWidth / 1080;

       this.scaleY = systemManager.stage.stageHeight / 1920;

  }

TOPICS
Development

Views

474

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Oct 23, 2016 0
Explorer ,
Oct 24, 2016

Copy link to clipboard

Copied

Solved.  Assigning dimension works.

  protected function preinitialize():void {

       this.width = 1080;

       this.height = 1920;

       this.scaleX = systemManager.stage.stageWidth / 1080;

       this.scaleY = systemManager.stage.stageHeight / 1920;

  }

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 24, 2016 0