c++ - Cocos2d-x Game screen not fit in iPhone 4 with iOS 7 -


i new cocos2d-x, found strange issue in game testing in simulator working fine. testing our game in iphone 5 , ipad thing working perfect got issue in iphone 4 device. there game screen display small , there show top , right side black area following screenshot:

enter image description here

i check default images size , resolution correct par apple guide line.

can please suggest me how fix issue. can't figure out there code related issue or need change in xcode.

following iphone 5 screen shot:

enter image description here


here appdelegate code:

bool appdelegate::applicationdidfinishlaunching() {     wrapper->authenticatelocalplayer();     // initialize director     ccdirector *pdirector = ccdirector::shareddirector();     pdirector->setopenglview(cceglview::sharedopenglview());     pdirector->setopenglview(cceglview::sharedopenglview());     // turn on display fps      pdirector->setdisplaystats(false);      // set fps. default value 1.0/60 if don't call     pdirector->setanimationinterval(1.0 / 60);     ccsize size = ccdirector::shareddirector()->getwinsize();      ipadx = size.width/1024;     ipady = size.height/768;      if (size.width==1024 || size.width==2048){         cceglview::sharedopenglview()->setdesignresolutionsize(1024, 768, kresolutionexactfit);         scalex = 1.0f;         scaley = 1.0f;     }     else     {              if (size.width<568)             {                 scalex = 960.0f/1024;                 scaley = 640.0f/768;              }             else             {                 scalex = 1136.0f/1024;                 scaley = 640.0f/768;              }     }          // create scene. it's autorelease object     ccscene *pscene = helloworld::scene();      // run     pdirector->runwithscene(pscene);      return true; } 

try this:

//set design resolution

 size designsize = size(960, 640);     if (size.width==1024 || size.width==2048){         designsize = size(1024, 768);         scalex = 1.0f;         scaley = 1.0f;     }     else     {          if (size.width<568)         {             scalex = 960.0f/1024;             scaley = 640.0f/768;          }         else         {             scalex = 1136.0f/1024;             scaley = 640.0f/768;             designsize = size(1136, 640);         }     }      cceglview::sharedopenglview()->setdesignresolutionsize(designsize.width, designsize.height, kresolutionexactfit);      cceglview::sharedopenglview()->setcontentscalefactor(max(768/designsize.height,1024/designsize.width) ); 

Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -