Hello I have menu scene that has mutltiple layers (NavLayer, BackgroundLayer ect). My NavLayer has a CCMenuItem Font that says "next". I have been trying all day to get the action on the -(void) to bring up my secondView controller. I have worked through all the examples on line and still cannot get my secondView from my Second View Controller to pop up..
Can anyone guide me as to what I might be doing wrong? Thanks
- (id) init {
if ((self=[super init])) {
[CCMenuItemFont setFontName:@"Marker Felt"];
[CCMenuItemFont setFontSize:40];
CCMenuItem *nextPage = [CCMenuItemFont itemFromString:@"next" target:self selector:@selector(next:)];
nextPage.position = ccp(810,60);
id color_action = [CCTintBy actionWithDuration:0.5f red:0 green:-255 blue:-255];
id color_back = [CCTintBy actionWithDuration:0.5f red:0 green:-255 blue:-255];
id seq = [CCSequence actions:color_action, color_back, nil];
[nextPage runAction:[CCRepeatForever actionWithAction:seq]];
CCMenu *menu=[CCMenu menuWithItems:nextPage, nil];
menu.position = CGPointZero;
[self addChild:menu];
}
return self;
}
-(void) next: (id) sender{
//---add the view of the view controller to the current view---
SecondViewController *secondView = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil];
[[[CCDirector sharedDirector] openGLView] addSubview:secondView];
}