我想設置我的mc到iPhone上使用空氣as3的確切屏幕大小。as3空氣的ios獲取屏幕設備分辨率
我已經厭倦了:
import flash.display.Screen;
import flash.geom.Rectangle;
var mainScreen:Screen = Screen.mainScreen;
var screenBounds:Rectangle = mainScreen.bounds;
/// Does not work - comes out 320 by 480
w.text = ""+screenBounds.width+"";
h.text = ""+screenBounds.height+"";
BG.height = screenBounds.height;
BG.width = screenBounds.width;
/// Does not work - comes out 320 by 480
w.text = ""+Capabilities.screenResolutionX+"";
h.text = ""+Capabilities.screenResolutionY+"";
BG.height = Capabilities.screenResolutionY;
BG.width = Capabilities.screenResolutionX;
/// Does not work - comes out 320 by 480
w.text = ""+stage.fullScreenwidth+"";
h.text = ""+stage.fullScreenHeight+"";
BG.height = stage.fullScreenHeight;
BG.width = stage.fullScreenWidth;
/// Works BUT... it does NOT stretch to fit the stage.
/// I am starting with android screen size and it shrinks it proportionally
/// which means there is space on top or bottom or left side.
w.text = ""+stage.stageWidth+"";
h.text = ""+stage.stageHeight+"";
BG.height = stage.stageHeight;
BG.width= stage.stageWidth;
EXACT_FIT的作品,但我的MC被壓扁。 :( 是否有一個allowScale? –
如果應用的縱橫比與設備的縱橫比不匹配,那麼您幾乎沒有選擇。您必須使用letterbox(顯示左邊的黑條),將它縮小(打破縱橫比)或剪輯一些內容 –
我想如果我只能得到正確的寬度和高度的屏幕,然後我可以只改變背景,但是這是行不通的 –