Is it possible to call CCMenu::initWithItems ?

Is it possible to call CCMenu::initWithItems ?
0.0 0


Hello, I have a question about this function:
bool initWithItems(CCMenuItem* item, va_list args);

If I have a subclass of CCMenu I would like to override init and call this function of the superclass.

I don’t see how to do this, you can not pass variable parameters to initWithItems because it takes a “va_args” and not a “...” and I don’t know how to package a va_args object.

Everyone I have checked seems to call this function:
static CCMenu* menuWithItems(CCMenuItem* item, ...);
but this seems silly as it means you have to create the menu items first and then pass them into the menu (the caller should not need to know about the menu items).

For now I am just using init and then adding the menu items using addChild. But what’s the recommended way of achieving this?


Sorry, I don’t find any better method than your’s. :slight_smile: