开发者

How to pass data in Android cocos2d menuItem selector?

开发者 https://www.devze.com 2023-03-23 00:11 出处:网络
In Iphone i am able to pass selector id like this way CCMenuItemSprite* item =[CCMenuItemSprite itemFromNormalSprite:normalSprite

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消