我使用cocos2d的:如何添加在cocos2d iPhone5的支持
-hd.png for iPhone HD
-ipad.png for iPad.
-ipadhd.png for iPad HD.
就像我們需要使用的iPhone 5這裏面延伸?另外如何在cocos2d中啓用iPhone 5支持?
更新1:輕鬆,我們可以支持的iPhone5這樣
#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];
最新通報2:使用一般功能...把這個cocos2d.h或任何共同文件
static inline NSString *i5res(NSString * data)
{
if(IS_IPHONE5)
{
return [data stringByReplacingOccurrencesOfString:@"." withString:@"-whd."];
}
return data;
}
//usage
CCSprite *bg = [CCSprite spriteWithFile:i5res(@"bg.png")];
更新3: Cocos2d現在也支持iphone5。 -iphone5hd
imageName-iphone5hd.png for iPhone 5 HD.
ok..thx的信息。 – Guru