sourcemars / cocos2d-android-1

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

CCMenuItem 无法正确识别点击位置 #51

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. 任意找两张按钮的图片
2. 构造一个CCMenuItem,设scale为0.5
3. 放进CCMenu,再把CCMenu放进CCLayer里

What is the expected output? What do you see instead?
点击按钮,按钮有反应;
实际是,按钮必须错开一些位置才有反应,估计是scale造成位
置判断错误;

What version of the product are you using? On what operating system?
android 1.6模拟器

Please provide any additional information below.
同样的做法,在cocos2d-iPhone是可行的。

Original issue reported on code.google.com by Yibi...@gmail.com on 11 Feb 2011 at 4:26

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
你可以看 项目中的issue9:
http://code.google.com/p/cocos2d-android-1/issues/detail?id=9&can=1&q=ccmenu

由于menu中用了scale的图片,所以touch事件响应出错。解决方法
是:
作者周为宽的:
 menu.setPosition(CGPoint.ccp(0,0)); 
without this line,  scaled menuItemImage can't repsond to touch event. 
thanks Weikuan  :)

Original comment by yeshengw...@gmail.com on 26 Apr 2012 at 9:47