How to edit/remove items from a CCMenu?

490 views Asked by At

I have a CCMenu that contains CCMenuItemSprite and CCMenuItemLabel. This menu is added to my layer as follows:

[self addChild:itemsMenu];

The menu is always visible to the user and contains objects that can be used by the user himself during the game. For instance, powerups that have limited life. When the player uses the objects, it must be removed from the menu.

Is there a way to delete only a single object in the CCMenu? Or do I have to recreate the full menu?

In my current implementation, I delete menu when the user finishes the number of uses associated to the CCMenuItemSprite with:

[self removeChild:itemsMenu cleanup:YES];
[self removeChild:itemsCountMenu cleanup:YES];

Thanks in advance for the help.

0

There are 0 answers