Follow Me on Twitter

Friday, March 16, 2012

Updating my cocos2d apps for the new iPad

Oy. When you make a cocos2d app for iOS, there is a boilerplate line in the App Delegate class... goes like this:

if( ! [director enableRetinaDisplay:YES] )
    CCLOG(@"Retina Display Not supported");


But, uh oh! New iPad is retina, too! I have at least 5 apps using that line of code. That makes the new iPad think it's in retina mode, so the display gets all messed up!

So here's the fix:

if(![AppDelegate isIPad]){
    if( ! [director enableRetinaDisplay:YES] ) {
        CCLOG(@"Retina Display Not supported");
    }
}

You can use your own "isIPad" methodology... I check for the height and width of the screen. Using this line, retina is not enabled for the new iPad, only for the other devices which support it... iPhone 4 and 4s. The next step, of course, would be to enable retina for new iPad and actually supply those double-sized huge graphics, but that's for another day.

And, even though I'm ready with new updates and have been for several days, only one of the 5 apps I submitted (Guess Your Songs) has made it through the Apple review queue... and that was after an expedite request ;)

You can find my iOS apps by searching for "daveworld" in the app store.

Any other snafus people have found getting ready for the new iPad? Any apps expected to misbehave on opening day?

No comments:

Post a Comment