문제

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;

}
도움이 되었습니까?

해결책

Move your code to the didMoveToView method:

-(void)didMoveToView:(SKView *)view {
    self.scene.view.paused = YES;
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top