I am implementing iAd into a SpriteKit game. I was setting up the game for iPhone retina versions and the two iPad sizes. The software works fine with the SKSceneScaleModeAspectFit and displays everything nicely.
Once I have added the ad banner, the whole scene jumps down by the double height of the ad. If I change to any other scale mode the scene is at the right place, but off course my the scene is not scaled as I have designed the game.
- (void)viewDidLoad
{
[super viewDidLoad];
int y=self.view.bounds.size.height;
skView = ((SKView *) self.view);
//skView.showsFPS = YES;
//skView.showsNodeCount = YES;
// Create and configure the scene.
//int x=skView.bounds.size.width;
SKScene *scene;
switch (y) {
case 1024:
case 2048:
scene = [kickupMyScene sceneWithSize:CGSizeMake(2048, 1536)];
break;
case 568:
scene = [kickupMyScene sceneWithSize:CGSizeMake(2272, 1280)];
break;
case 480:
scene = [kickupMyScene sceneWithSize:CGSizeMake(1920, 1280)];
break;
default:
scene = [kickupMyScene sceneWithSize:CGSizeMake(2048, 1536)];
break;
}
//scene.scaleMode = SKSceneScaleModeAspectFit;
[scene setYScale:0.2f];
[skView presentScene:scene];
// Present the scene.
self.canDisplayBannerAds=YES;
adView = [[ADBannerView alloc] initWithFrame:CGRectZero];
adView.frame = CGRectOffset(adView.frame, y/2-adView.frame.size.width/2, 0);
adView.delegate=self;
[skView addSubview:adView];
}
I could not find any solution for this problem so far, so any help is appreciated.