2

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 コマンドと矛盾します。

4

2 に答える 2

1

Androidでは、ファイルを編集するだけです

frameworks/runtime-src/proj.android/AndroidManifest.xml

プロジェクトディレクトリにあります。変化する

android:screenOrientation="landscape"

android:screenOrientation="portrait"
于 2014-06-04T12:56:33.277 に答える
0

プロジェクト 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
},
于 2015-05-10T14:49:49.223 に答える