You can try something like this. Create a new class and name it whatever you want (I named my GameStartMenu and will make it a subclass of SKScene)
In your ViewController.m file, replace MyScene with the new class name:
SKScene * scene = [GameStartMenu sceneWithSize:skView.bounds.size];
scene.scaleMode = SKSceneScaleModeAspectFill;
Then in your new .m class, enter something like this:
#import "GameStartMenu.h"
#import "MyScene.h"
@implementation GameStartMenu
-(id)initWithSize:(CGSize)size {
if (self = [super initWithSize:size]) {
self.backgroundColor = [SKColor colorWithRed:1.5 green:1.0 blue:0.5 alpha:0.0];
NSString *nextSceneButton;
nextSceneButton = @"Start";
SKLabelNode *myLabel = [SKLabelNode labelNodeWithFontNamed:@"Chalkduster"];
myLabel.text = nextSceneButton;
myLabel.fontSize = 30;
myLabel.fontColor = [SKColor blackColor];
myLabel.position = CGPointMake(CGRectGetMidX(self.frame), CGRectGetMidY(self.frame));
myLabel.name = @"scene button";
[self addChild:myLabel];
}
return self;
}
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touch = [touches anyObject];
CGPoint location = [touch locationInNode:self];
SKNode *node = [self nodeAtPoint:location];
if ([node.name isEqualToString:@"scene button"]) {
SKTransition *reveal = [SKTransition fadeWithDuration:3];
MyScene *scene = [MyScene sceneWithSize:self.view.bounds.size];
scene.scaleMode = SKSceneScaleModeAspectFill;
[self.view presentScene:scene transition:reveal];
}
}
@end
, (MyScene). , , , .. , , .