Thyrgle correctly describes the operation of CCMenuItem.
However, of course, there is a way to do what you want. All you have to do is subclass CCMenuItem and override the selected and unselected methods to achieve what you want. In fact, I'm sure you could just cut and paste the code from CCMenuItemLabel, because scaling an element to 1.2 is exactly what it does. (In fact, he does it better, as he animates zooming.)
-(void) selected { // subclass to change the default action if(isEnabled_) { [super selected]; [self stopActionByTag:kZoomActionTag]; CCAction *zoomAction = [CCScaleTo actionWithDuration:0.1f scale:1.2f]; zoomAction.tag = kZoomActionTag; [self runAction:zoomAction]; } } -(void) unselected { // subclass to change the default action if(isEnabled_) { [super unselected]; [self stopActionByTag:kZoomActionTag]; CCAction *zoomAction = [CCScaleTo actionWithDuration:0.1f scale:1.0f]; zoomAction.tag = kZoomActionTag; [self runAction:zoomAction]; } }
source share