简体   繁体   English

AIR for Android测试电影的奇怪行为

[英]AIR for Android test movie strange behaviour

I am developing a Game for Android with Flash IDE I am also using Starling library. 我正在使用Flash IDE开发Android游戏,也正在使用Starling库。 I have the following code in the Main.as: 我在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. 当我按Control + Enter ,测试电影窗口会显示我的游戏从左上角稍微移开了。 I tested the same code on an other computer with flash CS6 installed. 我在安装了Flash CS6的另一台计算机上测试了相同的代码。 Now the whole test window is blank, but when I package it as APK it works fine on devices. 现在整个测试窗口为空,但是当我将其打包为APK时,它在设备上可以正常工作。 If I run the SWF outside of the Flash IDE it runs fine too. 如果我在Flash IDE之外运行SWF,它也可以正常运行。

Have you tried to manually set the alignment of the stage? 您是否尝试过手动设置平台的对齐方式?

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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