【问题标题】:Adobe AIR Simulator displays wrong sizeAdobe AIR Simulator 显示错误的大小
【发布时间】:2014-10-16 22:30:07
【问题描述】:
我目前正在通过 Starling 和 AS3 开发游戏。
我遇到了一个奇怪的问题。我的模拟器不显示完整的阶段。
更好解释的图片:http://i.stack.imgur.com/OoMzt.png
我测试了一下,发现高度为 775 的 Quad 占据了 800 的 stageHeight 的整个高度。为什么会这样?应该有 25 个空格。
这是因为我在mac上运行,窗口显示错误吗?
【问题讨论】:
标签:
actionscript-3
air
screen
simulator
starling-framework
【解决方案1】:
//////////////////////////////////////////////////
//this is the size used to test NOT the device size
var widthDevelop:int = yourStageWidth;
//Example var widthDevelop:int = 480;
var screenWidth:int = stage.stageWidth;
var screenHeight:int = stage.stageHeight;
var viewPort:Rectangle = RectangleUtil.fit(
new Rectangle(0, 0, widthDevelop, screenHeight*(widthDevelop/screenWidth)),
new Rectangle(0, 0, screenWidth, screenHeight),
ScaleMode.NO_BORDER);
this._starling.viewPort = viewPort;
this._starling.stage.stageWidth = widthDevelop;
this._starling.stage.stageHeight = screenHeight*(widthDevelop/screenWidth);