Question

I have a CCMenuItemLabel on my scene, and when I press and hold my finger on the label it grows in size. Now I dont want that and I dont know how to do this.

I've searched for cocos2d ccmenuitemlabel hover but didnt find what I was searching for.

Was it helpful?

Solution

Extend CCMenuItemLabel and override two methods

-(void) selected {
    if(isEnabled_) {
        isSelected_=YES;
        // do your own anim here (or not !)
    }
}

-(void) unselected {
    if(isEnabled_) {
        isSelected_=YES;
        // undo whatever you did 
    }
}

OTHER TIPS

You can disable touches for the menu this item is contained in by setting isTouchEnabled to NO. If your menu contains other items than just create the labels in a different menu.

It is cumbersome but it will work.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top