This tutorial will be a two part series on how to enable retina display in Cocos2d and creating low resolution and high resolution images to use in your game, so that both iPhone 4 and lower generation models will support your optimized graphics. Keep in mind that iPhone 4 also runs in a low resolution mode. Lets begin….
Alright, first you will need to be working with Cocos2-iphone-0.99.5-rc1.tar.g. Any lesser versions do not support retina display. Once you have Xcode open create a new Cocos2d application and name it “retina_One,” or whatever you prefer to. Next, in the groups and files pane navigate to the classes folder and select “retina_OneAppDelegate.m.” Once you are inside that folder you will find the following block of code, simply uncomment that code and retina display will be enabled.
// Enables High Res mode (Retina Display) on iPhone 4 and maintains low res on all other devices // if( ! [director enableRetinaDisplay:YES] ) // CCLOG(@"Retina Display Not supported");
YES…it is that simple!!!
What Next ???
Enabling retina display is worthless if you don’t know how to create images that take advantage of it. Part 2 of this tutorial will teach you the way to achieve this.