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 <./ P>
그러나 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