Question

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).

Was it helpful?

Solution

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.

OTHER TIPS

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.

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