I used Cocos2d:
-hd.png for iPhone HD
-ipad.png for iPad.
-ipadhd.png for iPad HD.
Like this which extension we need to use for iPhone 5 ? Also how to enable iPhone 5 support in cocos2d ?
UPDATE 1: Easily we can support iPhone5 like this
#define IS_IPHONE5 (([[UIScreen mainScreen] bounds].size.height-568)?NO:YES)
#define TEX_GAME_BG (IS_IPHONE5) ? ( @"bg-whd.png") : ( @"bg.png")
mBG1 = [CCSprite spriteWithFile:TEX_GAME_BG];
UPDATES 2: Use general function...put this in cocos2d.h or any common file
static inline NSString *i5res(NSString * data)
{
if(IS_IPHONE5)
{
return [data stringByReplacingOccurrencesOfString:@"." withString:@"-whd."];
}
return data;
}
//usage
CCSprite *bg = [CCSprite spriteWithFile:i5res(@"bg.png")];
UPDATES 3: Cocos2d now support iphone5 also. -iphone5hd
imageName-iphone5hd.png for iPhone 5 HD.
There is no extension for iPhone5 size images in cocos2d. If you need to use images like this you will have to load them yourself.
Perhaps also think of how you could avoid the images altogether. If you are using background images, maybe you could use a tiled image instead?
To enable iPhone 5 support is the same as any iOS project, just add the [email protected] launch image to your project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With