Fork me on GitHub

适应不同的设备

CCSpriteBatchNode *chapter2SpriteBatchNode;  
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
[[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:@"scene1atlas.plist"]; // 3.1
chapter2SpriteBatchNode = [CCSpriteBatchNode batchNodeWithFile:@"scene1atlas.png"]; // 3.2
} else {
[[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:@"scene1atlasiPhone.plist"];// 3.1
chapter2SpriteBatchNode = [CCSpriteBatchNode batchNodeWithFile:@"scene1atlasiPhone.png"]; // 3.2
}

posted on 2012-04-05 12:00  pengyingh  阅读(130)  评论(0)    收藏  举报

导航