AS3 - 只有iOS的力量横向模式? [英] AS3 - iOS force landscape mode only?

查看:123
本文介绍了AS3 - 只有iOS的力量横向模式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经建立了一个游戏,这是专门为横向模式iOS和它工作得很好,只是,如果你打开​​设备,以肖像模式下,它停在那里与接口只填充关于屏幕的中间一半。我怎样才能迫使应用程序,只允许两个横向模式,而不是停留在纵向位置。

I've built a game for iOS that is designed for landscape mode and it works just fine except that if you turn the device to portrait mode it stops there to with the interface only filling about the middle half of the screen. How can I force the app to only allow the two landscape modes and not stop at the portrait position.

我已经尝试了所有的发布设置。长宽比设置为横向和自动定向检查的,如果我取消自动定向的应用程序不旋转到其他景点模式,我听说是从苹果自动拒绝。

I've tried all the publishing settings. Aspect Ratio is set for Landscape and Auto Orientation is checked on, if I uncheck AUto Orientation that the app does not rotate to the other landscape mode and I hear that's an automatic rejection from Apple.

这个程序是准备去除了这个小瑕疵。感谢您的帮助,您可以提供。

This app is ready to go except for this little flaw. Thanks for any help you can offer.

推荐答案

我前几天找到了答案,这比在Adobe论坛。

I found the answer to this over on the Adobe forums a few days ago.

设定的长宽比为自动。

设置自动定向到允许的。

Set Auto Orientation to allowed.

然后用这个code在您的主要片段:

Then use this code on your main clip:

var startOrientation:String = stage.orientation;
if (startOrientation == StageOrientation.DEFAULT || startOrientation == StageOrientation.UPSIDE_DOWN)
  {
    stage.setOrientation(StageOrientation.ROTATED_RIGHT);
  }
  else
  {
    stage.setOrientation(startOrientation);
  }                    

stage.addEventListener(StageOrientationEvent.ORIENTATION_CHANGING, orientationChangeListener);

function orientationChangeListener(e:StageOrientationEvent)
{
   if (e.afterOrientation == StageOrientation.DEFAULT || e.afterOrientation ==  StageOrientation.UPSIDE_DOWN)
   {
     e.preventDefault();
   }
}

正常工作对我来说..

Worked fine for me..

这篇关于AS3 - 只有iOS的力量横向模式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆