2013-08-22 43 views
0

我在以兩種方向(在iPad上)顯示我的應用程序時遇到問題。 有些時候,我的應用程序被卡住,所有的顯示對象都在右上角(只有當用戶在縱向模式下旋轉應用程序時纔會發生),其他方面應用程序很好。 我被困在這一點。我如何解決這個問題? 這裏是我的代碼:CoronaSDK方向問題

function onOrientationChange(event) 

    if system.orientation == "portrait" 
    or system.orientation == "portraitUpsideDown" then 

    _W = 768 
    _H = 1024 
    _X = _W/2 
    _Y = _H/2 

    else 

    _W = 1024 
    _H = 768 
    _X = _W/2 
    _Y = _H/2 

    end 

end 

Runtime:addEventListener("orientation", onOrientationChange) 

任何幫助將不勝感激?

Thannks。

回答

1

我想你可以從你的項目去掉上面的代碼,而只是增加你的build.settings文件中的以下(因爲你需要在兩個縱向模式方向)解決這個問題:

orientation = 
    { 
    default = "portrait", 
    supported = 
     { 
     "portrait", "portraitUpsideDown" 
     }, 
    }, 

保持編碼.. .............. :)

+0

感謝您的回覆......我解決了我的問題...... – Chomu