How do i remove the hover scale on CCMenuItemLabel?

268 Views Asked by At

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.

2

There are 2 best solutions below

0
YvesLeBorg On BEST ANSWER

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 
    }
}
3
giorashc On

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.