skview

How to dismiss SKScene?

谁说我不能喝 提交于 2019-11-28 08:26:30
When Im finished with my SKScene is there a way to dismiss the SKScene from within my SKScene class? If not back in my Viewcontroller where I present my SKScene [skView presentScene:theScene]; is there a way to restart the scene or remove in from my SKView? The SKScene Class Reference and SKView Class Reference are no help. Update: The following code removes my scene from my SKView [yourSKView presentScene:nil]; but when Im back in my view controller the scene is still running in the background. I can always pause it when the game is over and I'm sent back to my view controller(menu) but I'm

How to stop a audio SKAction?

痞子三分冷 提交于 2019-11-28 01:51:06
Goal: I want to present a new scene: [self.scene.view presentScene:level2 transition:reveal]; and end the current background music in order to start the new background music (the new background music from level 2). TheProblem: Upon presenting the new scene the background music of the 1. scene (level1) keeps playing and DOES not stop even when leaving the miniGame since the whole game consists of few mini games. The music played is an SKAction: @implementation WBMAnimalMiniGameLvL1 -(id)initWithSize:(CGSize)size { if (self = [super initWithSize:size]) { /* Setup your scene here */ self

Pausing a sprite kit scene

喜你入骨 提交于 2019-11-27 20:06:33
@property (SK_NONATOMIC_IOSONLY, getter = isPaused) BOOL paused; I found this line of code that I could add into my project, how would I pause my whole game? For example: -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ for (UITouch *touch in touches) { SKSpriteNode *pause = (SKSpriteNode*)[self childNodeWithName:@"pause"]; CGPoint location = [touch locationInNode:self]; // NSLog(@"** TOUCH LOCATION ** \nx: %f / y: %f", location.x, location.y); if([pause containsPoint:location]) { NSLog(@"PAUSE GAME HERE SOMEHOW"); } } } As you can see, I have the button set up. When i select

How to dismiss SKScene?

假如想象 提交于 2019-11-27 02:41:30
问题 When Im finished with my SKScene is there a way to dismiss the SKScene from within my SKScene class? If not back in my Viewcontroller where I present my SKScene [skView presentScene:theScene]; is there a way to restart the scene or remove in from my SKView? The SKScene Class Reference and SKView Class Reference are no help. Update: The following code removes my scene from my SKView [yourSKView presentScene:nil]; but when Im back in my view controller the scene is still running in the

Pausing a sprite kit scene

↘锁芯ラ 提交于 2019-11-26 22:53:42
问题 @property (SK_NONATOMIC_IOSONLY, getter = isPaused) BOOL paused; I found this line of code that I could add into my project, how would I pause my whole game? For example: -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ for (UITouch *touch in touches) { SKSpriteNode *pause = (SKSpriteNode*)[self childNodeWithName:@"pause"]; CGPoint location = [touch locationInNode:self]; // NSLog(@"** TOUCH LOCATION ** \nx: %f / y: %f", location.x, location.y); if([pause containsPoint:location

How to stop a audio SKAction?

吃可爱长大的小学妹 提交于 2019-11-26 22:01:20
问题 Goal: I want to present a new scene: [self.scene.view presentScene:level2 transition:reveal]; and end the current background music in order to start the new background music (the new background music from level 2). TheProblem: Upon presenting the new scene the background music of the 1. scene (level1) keeps playing and DOES not stop even when leaving the miniGame since the whole game consists of few mini games. The music played is an SKAction: @implementation WBMAnimalMiniGameLvL1 -(id