4GetFullOf
4GetFullOf

Reputation: 1738

Pausing SKScene at startup

I want to pause my SKScene within my SKScene class. I know the following code works to pause the Scene and the game has already started.

self.scene.view.paused = YES;

But I want to pause my scene AS SOON as my scene starts from WITHIN my class. So what method is best to used for this situation?

-(id)initWithSize:(CGSize)size {    
    if (self = [super initWithSize:size]) {

    self.paused = YES;

}
    return self;

}

Upvotes: 0

Views: 1653

Answers (1)

Batalia
Batalia

Reputation: 2435

Move your code to the didMoveToView method:

-(void)didMoveToView:(SKView *)view {
    self.scene.view.paused = YES;
}

Upvotes: 6

Related Questions