cocos2d-x 画面の縦固定と横固定(Android)
2017/10/25
cocos2d-xではデフォルトで画面が横の固定になっているので、
これを縦の固定に変えてみる。
AndroidManifest.xml
のファイルの中の、下記の
screenOrientationのパラメータ部分を変更する。
<activity android:name=".SimpleGame"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:configChanges="orientation">
screenOrientationの値は下記となるのでメモ。
cocos2d-xでは横固定(landscape)なので縦固定(portrait)に変えてみた。
unspicified : システム自動設定 ユーザーの画面の向けた方向に自動回転
landscape : 横方向固定
portrait : 縦方向固定
user : 現在のレイアウトに従う ユーザーの操作により切り替わる
behind : 親のアクティビティーに従うユーザーの操作により切り替わる
sensor : センサーに従う
nosensor : センサーを無視