Pregunta

¿Cómo puedo configurar la orientación de la vista en Cocos2D-JS 3.0?

Encontré las variables

cc.UIInterfaceOrientationPortrait
cc.UIInterfaceOrientationLandscapeLeft
cc.UIInterfaceOrientationLandscapeRight
cc.UIInterfaceOrientationPortraitUpsideDown

en ccinpumanager.js, pero no hay función para establecerlos.

y encontré esta descripción:

http://www.cocos2d-x.org/wiki/device_orientation

Pero es diferente para Android y iOS y eso contradice el comando COCOS RUN.

¿Fue útil?

Solución

en Android solo edita el archivo

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

en el directorio del proyecto.CAMBIO

android:screenOrientation="landscape"

a

android:screenOrientation="portrait"

Otros consejos

Puede cambiar en su proyecto 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
},

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top