0

I have recently coded in a menu item, the "Game Over" Label appears but the menu item "Restart" isn't. I have no idea why?

Can anyone help, here is whats in my method !

 CGSize winSize = [[CCDirector sharedDirector] winSize];
CCLabelTTF *label = [CCLabelTTF labelWithString:@"Game Over"
                                       fontName:@"Marker Felt"
                                       fontSize:64];
label.color = ccRED;
label.position = ccp(winSize.width*0.5, winSize.height*0.75);
[self addChild:label];


CCMenuItem *item = [CCMenuItemFont itemWithString:@"Restart"
                                           target:self
                                         selector:@selector(restartGame)];
CCMenu *menu = [CCMenu menuWithItems:item, nil];
[menu alignItemsVertically];




[self addChild:menu];
Josh
  • 745
  • 1
  • 7
  • 22

1 Answers1

1

try this code:

menu.position = ccp(winSize.width/2, winSize.height/2);

set the specific position.

KARTHIK RA
  • 469
  • 2
  • 8