简体   繁体   中英

AIR for Android test movie strange behaviour

I am developing a Game for Android with Flash IDE I am also using Starling library. I have the following code in the Main.as:

var myStarling:Starling;
var viewPort:Rectangle = new Rectangle(0,0,480,800);
myStarling = new Starling(Game, stage , viewPort);
myStarling.start();
myStarling.showStats = true;
myStarling.stage.stageWidth = 480;
myStarling.stage.stageHeight = 800;

When I hit Control + Enter the test movie window shows my game slightly displaced from top left corner. I tested the same code on an other computer with flash CS6 installed. Now the whole test window is blank, but when I package it as APK it works fine on devices. If I run the SWF outside of the Flash IDE it runs fine too.

Have you tried to manually set the alignment of the stage?

stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM