Iphone 5 with black border

Hi,
I develop a game using cocos2d-x 2.1.2hotfix,
I test my game in iPod 4th, Ipad 2 and Iphone 5.
Ipod 4th and Ipad 2 works ok, but on Iphone 5 he game got black borders in both sides of the screen.

This is the code that I use in my app delegate, I get it from a old version of cocos2d-x.

    CCDirector *pDirector = CCDirector::sharedDirector();

    pDirector->setOpenGLView(CCEGLView::sharedOpenGLView());

    CCEGLView::sharedOpenGLView()->setDesignResolutionSize(480, 320, kResolutionExactFit);

    //[pDirector setProjection:kCCDirectorProjection2D];
    pDirector->setProjection(kCCDirectorProjection2D);
    // turn on display FPS
    pDirector->setDisplayStats(false);

    // set FPS. the default value is 1.0/60 if you don't call this
    pDirector->setAnimationInterval(1.0 / 60);

    // create a scene. it's an autorelease object
    CCScene *pScene = MenuScene::scene();

    // run
    pDirector->runWithScene(pScene);
    return true;

Make sure you added Default-568h@2x.png to your project.

1 Like

It works for me, thank you.