osx - How do I change the starting screen size in Cocos2d-x 3.1 for Mac target? -


my app supposed run in portrait. ios specify in plist file. android it's in manifest.

when try run mac app launches in landscape, though it's supposed in portrait.

i've tried find mainmenu.xib file specified in mac plist via xcode search, in 3.1 project, there wasn't 1 able found. tried looking through mac specific files under platform->mac didn't see related screen sizes.

edit update:

in addition @gamedeveloper answer, made following changes:

if( !glview) { #if (cc_target_platform == cc_platform_mac)     glview = glview::createwithrect("myapp", rect(0,0, 640, 960)); #else     glview = glview::create("myapp"); #endif } 

it should noted supplied rect ideally design size.

there no xib or nib.

in v 3.0

in main.cpp should have:

int main(int argc, char *argv[]) {     appdelegate app;     eglview eglview;     eglview.init("hello world",900,640);     return application::getinstance()->run(); } 

change 900 , 640 values -> width, height

in v3.1

in appdelegate.cpp should edit applicationdidfinishlaunching add glview->setframesize(900, 640); 900 , 640 width , height

// initialize director auto director = director::getinstance(); auto glview = director->getopenglview(); if(!glview) {     glview = glview::create("my game");     glview->setframesize(900, 640);     director->setopenglview(glview); } 

you want make sure adjust when running on mac


Comments

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -