开发者

Cocos2d menuitem mouse touch event?

开发者 https://www.devze.com 2023-03-12 01:35 出处:网络
Now I want the menuitem to call the touch delegate , but when I set the isTouchEnabled is yes and some delegate methods , but when I touch or move on the menuitem开发者_如何转开发 , it didn\'t work ,w

Now I want the menuitem to call the touch delegate , but when I set the isTouchEnabled is yes and some delegate methods , but when I touch or move on the menuitem开发者_如何转开发 , it didn't work ,why ?


this may be a stupid point but make sure ur calling istouchenabled on a cclayer and not a scene.


you must make sure no other CCNode cover the menuItem that you want to touched,because something the visible of some CCNode is false,so which may cover the menuItem.if so,you should make the index(z property) of covering CCNode less than the menuItem.wish this words help you,thanks!

0

精彩评论

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

关注公众号