質問

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
},
.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top