Christian Kreiter
Christian Kreiter

Reputation: 620

(SpriteKit Objective-C) Scene Stretched Out After Transition

When I transition from MainMenuScene.m to SceneLvl1.m, the transition works perfectly fine. But when transitioning back from SceneLvl1.m to MainMenuScene.m, all the sprites are distorted. They're stretched out to almost 3x their original width! Here's my transitioning code:

// Main Menu initialization.
    MainMenuScene *mainMenu = [[MainMenuScene alloc] init];


// Move to the main menu.
[self.scene.view presentScene:mainMenu
                       transition:[SKTransition fadeWithColor:[SKColor blackColor]
                                                     duration:3.0]];

So, what could I be doing wrong, here?

Upvotes: 0

Views: 72

Answers (1)

Elindor
Elindor

Reputation: 175

This might sound a stupid question, but are you calling simply init in it? Any scene initialization should use initWithSize, right? Try replacing with

    MainMenuScene *mainMenu = [[MainMenuScene alloc] initWithSize:self.view.frame.size];

Upvotes: 1

Related Questions