一時停止ボタンが右上隅にあるはずのゲームがありますが、iPhone 5 では上部の 3/4 の位置にあるため、手動で設定しようとしましたが、機能しません。動作しますが、iPhone 3 & 4 では表示されません (したがって、明らかに IF ステートメントの一部を無視しています)。
CCMenuItemSprite* item1 = [CCMenuItemSprite itemWithNormalSprite:[CCSprite spriteWithFile:[[MainInfo shareInstance] getImageName:@"pause1.png"]]
selectedSprite:[CCSprite spriteWithFile:[[MainInfo shareInstance] getImageName:@"pause2.png"]]
target:self
selector:@selector(soundOff)];
CCMenu *menu = [CCMenu menuWithItems:item1, nil];
if ( ![[MainInfo shareInstance] isIPad] )
menu.position = ccp(290, 450); //450 iPhone3/4
// else
if (IS_IPHONE_5) {
// do something specific for iPhone 5
menu.position = ccp(290, 530); //450 iPhone3/4
}else
menu.position = ccp(696, 960);
[_bottomFrame addChild:menu z:30 tag:1234];
[self updateBoard];
}
.m ファイルの先頭には、次のものがあります。
#define IS_IPHONE_5 ([UIScreen mainScreen].bounds.size.height == 568.0)
上記のコードを正しく書く方法を教えてください。
どうもありがとう
クリス