Pergunta

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;

}
Foi útil?

Solução

Move your code to the didMoveToView method:

-(void)didMoveToView:(SKView *)view {
    self.scene.view.paused = YES;
}
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top