Domanda

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.

È stato utile?

Soluzione

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 
    }
}

Altri suggerimenti

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top