Domanda

CCMenuItem default fires its block on touchup. I'd like to change this to touchdown. Anyway to perform this without modifying CCMenu class (which would break other parts). Can this be done in a category?

Wonder why the events are not implemented same way as UIKit (free event selection).

È stato utile?

Soluzione

You can subclass CCMenuItem and make this behaviour possible by overriding selected, unselected and activate, depending on your needs.

You can then use your new class in CCMenu so that you can lay it out automatically and the rest of your app will continue to function.

Altri suggerimenti

You can still use a CCMenuItem outside of a CCMenu and toggle touches yourself. Use the selected, unselected and activate methods. No need to modify the CCMenu.

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