How to pass data in Android cocos2d menuItem selector?
In Iphone i am able to pass selector id like this way
CCMenuItemSprite* item =[CCMenuItemSprite itemFromNormalSprite:normalSprite
selectedSprite:selectedSprite target:tar开发者_高级运维get selector:@selector(LaunchLevel:)];
and the selected menuItem tag is obtained by
- (void ) LaunchLevel: (id) sender
{
// Do Something
CCMenuItemSprite *temp = (CCMenuItemSprite *)sender;
}
My question is how to do the similar code in android? Means how to pass the id of the MenuItem
You cannot do this for the moment. If you check the code source there is nothing for this purpose. But as cocos2d is open source, nothing prevents you to implement this feature.
精彩评论