How to set portrait mode with libGDX?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-12 10:28:51

问题


I've created a game, and it is OK in desktop mode, but when i launch it on my S3, it goes in landscape mode, how can i change it?

Thank you in advance


回答1:


android:screenOrientation:

  • landscape
  • portrait
  • unspecified
  • behind
  • reverseLandscape
  • reversePortrait
  • sensorLandscape
  • sensorPortrait

For more information you can visit: Android Activity Element




回答2:


Have a look at the <activity> element. You can set the orientation as:

android:screenOrientation=["unspecified" | "behind" |
                                     "landscape" | "portrait" |
                                     "reverseLandscape" | "reversePortrait" |
                                     "sensorLandscape" | "sensorPortrait" |
                                     "userLandscape" | "userPortrait" |
                                     "sensor" | "fullSensor" | "nosensor" |
                                     "user" | "fullUser" | "locked"]


来源:https://stackoverflow.com/questions/23402717/how-to-set-portrait-mode-with-libgdx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!