ho usato Cocos2d:Come aggiungere il supporto iPhone5 in cocos2d
-hd.png for iPhone HD
-ipad.png for iPad.
-ipadhd.png for iPad HD.
Ti piace questa estensione, che abbiamo bisogno di usare per iPhone 5? Inoltre, come abilitare il supporto per iPhone 5 in cocos2d?
UPDATE 1: facilmente possiamo sostenere iPhone5 come questo
#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];
AGGIORNAMENTI 2: Utilizzare la funzione generale ... mettere questo in cocos2d.h o qualsiasi altro file comune
static inline NSString *i5res(NSString * data)
{
if(IS_IPHONE5)
{
return [data stringByReplacingOccurrencesOfString:@"." withString:@"-whd."];
}
return data;
}
//usage
CCSprite *bg = [CCSprite spriteWithFile:i5res(@"bg.png")];
AGGIORNAMENTI 3: Ora Cocos2d supporta anche iphone5. -iphone5hd
imageName-iphone5hd.png for iPhone 5 HD.
ok..thx per le informazioni. – Guru