iPhone – create a menu in CoCos2D?

I need to know how to make a simple menu with 5 buttons and place them on the right side of the cocos2d screen. Do I create the menu in – (id)init? Any help is appreciated. Thanks!
You can use the following code to create a menu

 CCMenuItemImage *menuItem1 = [CCMenuItemImage itemFromNormalImage:@"menu.png" selectedImage:@"menu1.png" 
target:self selector:@selector(onClick:)];

CCMenu *menu = [CCMenu menuWithItems:menuItem1,nil];
menu.position = ccp(320,480);

[self addChild:menu z:100];

I hope this Can help…..

I need to know how to make a simple menu with 5 buttons and place them on the right side of the cocos2d screen. I’m at-(id ) Is the menu created in init? Any help is appreciated. Thanks!

You can use the following code to create a menu

CCMenuItemImage *menuItem1 = [CCMenuItemImage itemFromNormalImage:@"menu. png" selectedImage:@"menu1.png" 
target:self selector:@selector(onClick:)];

CCMenu *menu = [CCMenu menuWithItems:menuItem1,nil];
menu.position = ccp(320,480);

[self addChild:menu z:100];

Hope this can help…..

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 1081 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.