簡體   English   中英

用戶退出Android AIR游戲時影片剪輯的位置發生變化

[英]Movie Clips Position Changes when user Backs out of Android AIR Game

大家好,我的Android AIR游戲遇到了這個奇怪的問題。

因此,游戲上的所有內容都完美對齊,但是我遇到的問題是,當用戶退出應用程序然后又返回應用程序以繼續播放影片剪輯時,將自己完全重新定位在屏幕的右下角。 他們不會超出比例或只是重新定位而已。 我不明白為什么會這樣? 目前,這是我用來擴展Android設備所有內容的方式:

//Screen size for all devices
        stage.align = StageAlign.TOP_LEFT;
        stage.scaleMode = StageScaleMode.EXACT_FIT;
        stage.displayState = StageDisplayState.FULL_SCREEN;
        trace(stage.fullScreenWidth, stage.fullScreenHeight);

這段代碼對我一直有效,但是說用戶離開了應用程序,當他們返回此影片剪輯或當前影片剪輯時:

        loadingScreen = new mcLoadingScreen();
        stage.addChild(loadingScreen);
        loadingScreen.x = (stage.stageWidth / 2);
        loadingScreen.y = (stage.stageHeight / 2);

將重新放置在屏幕底部的右側。 有任何想法嗎? 多謝您的協助,不勝感激!

我也似乎縮小了范圍。 僅當用戶按下“主頁”按鈕並且屏幕方向從我設置為“橫向”的屏幕變為“縱向”時,才會發生這種情況。 因此,當我回到應用程序中時,所有的影片剪輯都已重新定位

嘗試更改這些配置(我並不是說這可以解決問題,只是建議適用於iOS設備的某些功能):

stage.scaleMode = StageScaleMode.NO_SCALE;
// stage.displayState = StageDisplayState.FULL_SCREEN;

在您的應用程序描述符(XML文件)中

<aspectRatio>portrait</aspectRatio>
<autoOrients>false</autoOrients>
<fullScreen>true</fullScreen>

如果不起作用,@ Aaron可能會建議您開始解決此問題:

NativeApplication.nativeApplication.addEventListener(Event.ACTIVATE, function(event:Event):void
{
      // the application is reactivated 
});

NativeApplication.nativeApplication.addEventListener(Event.DEACTIVATE, function(event:Event):void
{
      // the application is deactivate to receive a phone call or when the user presses the Home button, etc
});

添加一些跟蹤,並驗證哪些更改。 如果您具有事件監聽器,例如ENTER_FRAME,Event.RESIZE,請注意並在停用應用程序時刪除這些事件監聽器。

希望有可能以某種方式幫助您。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM