COCOS2D-JS:ビューポートの向きを設定する方法(横/縦)
-
21-12-2019 - |
質問
COCOS2D-JS 3.0のビューポートの向きを設定する方法は?
変数
を見つけましたcc.UIInterfaceOrientationPortrait
cc.UIInterfaceOrientationLandscapeLeft
cc.UIInterfaceOrientationLandscapeRight
cc.UIInterfaceOrientationPortraitUpsideDown
.
ccinputmanager.jsではなく実際にそれらを設定する機能はありません。
と私はこの説明を見つけました:
http://www.cocos2d-x.org/wiki/device_orientation
しかし、それはAndroidとiOSとは異なり、それはCocos Runコマンドと矛盾します。
解決
Androidファイルを編集するただ
frameworks/runtime-src/proj.android/AndroidManifest.xml
.
プロジェクトディレクトリに。変更
android:screenOrientation="landscape"
.
android:screenOrientation="portrait"
. 他のヒント
プロジェクトconfig.json
で変更できます {
"init_cfg":{
"isLandscape": false,
"isPotrait":true,
"isWindowTop": false,
"name": "untitled",
"width": 960,
"height": 640,
"entry": "main.js",
"consolePort": 6050,
"uploadPort": 6060,
"debugPort": 5086
},
. 所属していません StackOverflow