iphone - Customizing Cocos2D menus -


i've decided stick cocos2d game dev... menus there way make more customizable, maybe instead of text maybe image there way arrange them differently versus in center of screen

check tutorial have done cocos2d menus.

it quite simple present images instead of text, , should select when creating menu item. have @ menuitemimage class.

as can see in suggested tutorial piece of code create menu

// creating menu items         menuitem *start = [menuitemfont itemfromstring:@"start" target:self selector:@selector(start:)];         menuitem *settings = [menuitemfont itemfromstring:@"settings" target:self selector:@selector(settings:)];         menuitem *credits = [menuitemfont itemfromstring:@"credits" target:self selector:@selector(credits:)];               menuitem *help = [menuitemfont itemfromstring:@"help" target:self selector:@selector(help:)];          // creating menu , adding items         menu *menu = [menu menuwithitems:start, settings, credits, help, nil];         // set menu alignment vertical         [menu alignitemsvertically];

in case, instead of use:

menuitem *start = [menuitemfont itemfromstring:@"start" target:self selector:@selector(start:)];
con do

menuitem *start = [menuitemimage itemfromnormalimage:@"nameofyournormalimage.png" selectedimage:@"nameofyourselectedimage.png" target:self selector:@selector(start:)];

to position menu, should define cgpoint , set menu position point.

[menu setposition:ccp(positiononx, positionony)];

i hope looking for.

cheers,
vfn


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -