keweibing / cocos2d-android

Automatically exported from code.google.com/p/cocos2d-android
Other
0 stars 0 forks source link

Urgent:No click event after setting rotation to MenuItem #30

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,
I am trying to create a CCMenu which keeps object of CCMenuItemImage. With some 
checked I need to rotate CCMenu, but after setting rotation I am getting event 
on "selector" provided with CCMenuItemImage.

I have downloaded Cocos2D android at the end of Jan 2011. 
Following are the details of the code I have downloaded:
1. cocos2d-android : 0.82
2. android:versionCode="5" 
3. android:versionName="1.0.3" 

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

Result: When ever I set Rotation, I am not getting event on my "buttonHandler" 
method, but if I removed setRotation statement then I am getting event on 
"buttonHandler".

Please let me know how could I achieve this. Is there a different way to do 
that or it is a API level issue?

I would also like to mention some API level issue for cocos2D-Android later on.

Please provide me solution for this.

Thank you,
Regards,
Aparna

Original issue reported on code.google.com by aparnabh...@gmail.com on 31 Mar 2011 at 2:50