开发者

cocos2d button click boundary problem

i am new to iPhone and cocos2d in general, i m reading tutorials and tried to come up with application that contains a menu i m using cocos2d menu items

the problem is that i found while testing my applications that the buttons respond to clicks on some area around the button (not only the button sprite rectangle boundary), and while using multiple buttons (10 menu items) blew each other (not overlapping) : when i click on one of them another button is pressed (the "is-pressed" sprite is used) and the handler is called (the handler of the button that i did not press)

and while i was testing animation on menu (i used "move by" on the menu) i noticed that some buttons (almost all on them in most cases) do not respond to touch after move by (when click the "is-pressed" sprite is not used and handle is not called ----> not click on the button happens).

i tried to test on the iPhone to check if it was a simulator error , but it had the same behavior as the simulator with the same problem.

i tried to place the menu on a separate layer and 开发者_Python百科also tried to place each button in a separate menu and placed all the menus on the same page : and got the same results

i think i m using the latest version on cocos2d for iPhone


The problem was that i used to zoom by moving the camera to and away to get the zoom in/out effect

and there is an old problem which require the use a projection calculation to get the real point (after calculation the projection due to zoom)

the boundary detection of the buttons does not handle that problem

so all what i can say that it is a classic problem in the library that migrated through couple of generations

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜