• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Cocos2D-android: click event issue while setting rotation for menu item

Hello All,

I am developing a game using Cocos2D-Android.
I am getting issue while setting rotation to CCMenu item. After setting rotation I am not getting Click event on that menu, but If I remove rotation then I am getting proper click event.

Please let me know is it a right place to add thread for Cocos2D queries? If yes then please help me to solve this issue. If no then please provide me link where I can post this query if anyone know.

Here is the sample of code which I am trying to implement:

CCMenuItemImage arrow = CCMenuItemImage.item(
"arrow.png", "arrow_t.png", this, "buttonHandler");

arrow.setPosition(CGPoint.ccp(0, 0));
arrow.setTag(10);

CCMenu tmpMenu = CCMenu.menu(arrow);
tmpMenu.setScale(0.5f);
tmpMenu.setAnchorPoint(CGPoint.ccp(0, 0));

if (/*Some condition*/) {
tmpMenu.setRotation(/*With some value lets say 90*/);
tmpMenu.setPosition(/* Some CGPoint value /);
}
else{
tmpMenu.setPosition(/*Some position/);
}

addChild(tmpMenu);

Thank you,
Regards,
Aparna
 
Back
Top Bottom