COCOS2D-JS: Come impostare l'orientamento della vista (paesaggio / ritratto)?
-
21-12-2019 - |
Domanda
Come posso impostare l'orientamento del mirino in COCOS2D-JS 3.0?
Ho trovato le variabili
cc.UIInterfaceOrientationPortrait
cc.UIInterfaceOrientationLandscapeLeft
cc.UIInterfaceOrientationLandscapeRight
cc.UIInterfaceOrientationPortraitUpsideDown
.
in ccinputManager.js ma nessuna funzione per impostarli effettivamente.
E ho trovato questa descrizione:
http://www.cocos2d-x.org/wiki/device_orientation .
Ma è diverso per Android e IOS e che contraddice il comando Eseguito di COCOS.
Soluzione
A Android basta modificare il file
frameworks/runtime-src/proj.android/AndroidManifest.xml
.
nella directory del progetto.Cambia
android:screenOrientation="landscape"
.
a
android:screenOrientation="portrait"
. Altri suggerimenti
È possibile modificare nel progetto 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
},
. Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow