buttons and menu items in cocos2d/objective-c
In my app, I'd like a method called whenever the user taps the screen (anywhere on the screen). Normally, I'd make a transparent UIButton that covers the whole screen.
If I'm using the cocos2d framework, what's the best way to do this? Is it good practice to still use UIButtons? I've been reading about MenuItems but haven't found an easy way to make one giant fully tr开发者_如何学运维ansparent menu item?
Thanks.
try implementing touchesBegan:withEvent:
. You can get the location and it supports mutltitouch (if you have enabled it on that view)
Try using CCMenu / CCMenuItem
check this link for more info...
http://www.cocos2d-iphone.org/api-ref/0.99.2/interface_c_c_menu_item.html
精彩评论