I am developing universal game for all iPhone 4 and higher and for all iPads, I want it work for IOS 7 and 8. I have tried a lot of macros but never they work ether for all devices or IOS 7 and 8.I am a beginner developer and I dont know how to solve this problem. I uploaded images to dropbox and you can get them at this link here https://www.dropbox.com/sh/pnll2e2jvo0uigs/AACOLbzzQqZlJEZZcBx7TMR1a?dl=0
here is the code I am using for my SpriteKit game to add background to the scene:
#import "GameScene.h"
#import <UIKit/UIKit.h>
#define IS_WIDESCREEN (( fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.height - ( double )568 ) < DBL_EPSILON ) || ( fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.width - ( double )568 ) < DBL_EPSILON ))
@implementation GameScene
-(id)initWithSize:(CGSize)size {
if (self = [super initWithSize:size]) {
SKSpriteNode*background;
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone){
if (IS_WIDESCREEN){
background = [SKSpriteNode spriteNodeWithImageNamed:@"Background-568"];
}else{
background = [SKSpriteNode spriteNodeWithImageNamed:@"Background"];
}
}else{
background = [SKSpriteNode spriteNodeWithImageNamed:@"Background~iPad"];
}
background.anchorPoint = CGPointMake(0.5, 1);
background.position = CGPointMake(self.size.width/2, self.size.height);
//background.zPosition = LayerBackground;
[self addChild:background];
}
return self;
}
@end
I would much appreciate if you could help me to solve this problem and give me the code in answer you post, like what macros to put and usage of it. also use my code for background and images uploaded to dropbox. Thanks a lot.