I'm using a basic setup with a SKView to display a SKScene. The SKScene has a pre-defined size and uses a scale mode SKSceneScaleModeAspectFit:
- (void)viewDidLoad {
[super viewDidLoad];
SKView *skView = (SKView *)self.view;
SKScene *scene = [MyScene sceneWithSize:CGSizeMake(320, 480)];
scene.scaleMode = SKSceneScaleModeAspectFit;
[skView presentScene:scene];
}
As expected, on iPhone 5 this causes letterboxing, i.e. black sections above and under my scene. On iPad, letterboxing causes black stripes to the left and right of the scene.
However, I'd like to position the scene e.g. on iPhone 5 so that the scene is aligned to the bottom of the screen, while all of the black space is positioned above the scene. Is this possible?
I've tried quite a few things with .frame .center .origin, etc. properties of the SKView/SKScene, but can't seem to be able to move the 'display area'. For example, adding
[scene runAction:[SKAction moveTo:CGPointMake(0,-44) duration:0]];
moves the scene's contents inside the display area but not the area itself.
Any ideas?