Game Development Reference
In-Depth Information
need to care about is that you need two images instead of one, or four if you create a
universal app.
In theory, it's also possible to use only HD graphics and then scale them down at
runtime using the scale property of sprites to match the display resolution. But this
comes with a major drawback: memory usage! The HD image in Figure 6-1 uses 128
KB of texture memory, assuming 32-bit color quality. The SD version consumes only
32 KB of memory. The non-Retina devices have generally half the memory (or less)
than Retina devices and quickly run out of memory when you have them load textures
taking up four times as much memory as needed.
Figure 6-1 . Sprites in two resolutions for HD (Retina) and SD (non-Retina) displays
Displaying a scaled-down version of an image also incurs a performance penalty be-
cause four times more pixels must be processed each frame to display a scaled-down
version of the image. On the other hand, upscaling standard resolution images for Ret-
ina devices simply provides no visual improvement, so you could just as well disable
Retina mode in cocos2d altogether and simply provide only SD assets.
To enable support for Retina display resolutions in cocos2d, you must call the CCDir-
ector method enableRetinaDisplay . Typically this is already done as part of
the AppDelegate initialization code, so you only need to change this if you abso-
lutely don't plan to have Retina assets in your app and want to disable Retina mode.
if (![director enableRetinaDisplay:YES])
{
CCLOG(@"Retina Display Not supported");
}
 
 
Search Nedrilad ::




Custom Search