So I create an SKLabelNode: EDIT: CHANGED CODE TO: //.h {SKLabelNode *PausedLabel22;} //.m PausedLabel22= [SKLabelNode labelNodeWithFontNamed:@"Chalkduster"]; PausedLabel22.text = @"Game Paused"; PausedLabel22.fontSize = 30; PausedLabel22.fontColor = [SKColor blackColor]; PausedLabel22.position = CGPointMake(160, 340); //[self addChild:PausedLabel22]; This used to perfectly fine, but then I have my method:
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
if (paused == YES) {
paused = NO;
[PausedLabel22 removeFromParent];
NSLog(@"UnPaused");
}else if (touchLocation.x > self.frame.size.width - 80 && touchLocation.y > self.size.height-80 && touchLocation.y < self.size.height-40) {
paused = YES;
NSLog(@"Paused");
//PausedLabel22.text = [NSString stringWithFormat:@"Game Paused"];
//PausedLabel22.fontColor = [SKColor blackColor];
//PausedLabel22.position = CGPointMake(160, 320);
[self addChild:PausedLabel22];
}
NSLog(@"Text Postion: (%f, %f)", PausedLabel22.position.x, PausedLabel22.position.y);
NSLog(@"Text: %@", PausedLabel22.text);
NSLog(@"Text color: %@", PausedLabel22.fontColor);
My log shows me: 2014-03-15 23:12:12.734 NuclearGame[1418:60b] UnPaused 2014-03-15 23:12:12.735 NuclearGame[1418:60b] Text Postion: (160.000000, 320.000000) 2014-03-15 23:12:12.736 NuclearGame[1418:60b] Text: Game Paused 2014-03-15 23:12:12.737 NuclearGame[1418:60b] Text color: UIDeviceRGBColorSpace 0 0 0 0 2014-03-15 23:12:13.248 NuclearGame[1418:60b] Paused 2014-03-15 23:12:13.251 NuclearGame[1418:60b] Text Postion: (160.000000, 320.000000) 2014-03-15 23:12:13.252 NuclearGame[1418:60b] Text: Game Paused 2014-03-15 23:12:13.254 NuclearGame[1418:60b] Text color: UIDeviceRGBColorSpace 0 0 0 1
However, on screen the label will have appeared (since it was called at the start) then disappear just fine, but never reappear on screen!
EDIT: Label still did not show up...