문제

My SKScene is vertically squashed. I have added an SKEmitterNode, but this is clearly being squished and I have no idea why.

I have another emitter in another scene which is not doing this and all the code appears to be exactly the same.

Normal: (http://i.imgur.com/xL7GVvd.png)

Squashed: (http://i.imgur.com/O0xMeFC.png)

Edit:

The code is IDENTICAL for both.

// Configure the view.
SKView * skView = (SKView *)self.view;
// Create and configure the scene.
SKScene * scene = [MyScene sceneWithSize:skView.bounds.size];
scene.scaleMode = SKSceneScaleModeAspectFill;
// Present the scene.
[skView presentScene:scene];
도움이 되었습니까?

해결책 2

As per the comment by Simon Jenkins, moving the layout code to viewWillLayoutSubviews() instead of viewDidLoad() solved the issue.

다른 팁

Your scaleMode property seems off.

Try scene.scaleMode = SKSceneScaleModeAspectFill; or scene.scaleMode = SKSceneScaleModeAspectFit; depending on your requirements.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top