info on touch handling

info on touch handling
0.0 0


i wondered is there any decent tutorial/guide/sample/project that shows how touch handling is done in a good clean and elegant way. i know how i can get the touches but i don’t want to compare each touch with a rect of a sprite and also keep the z-order and transparency in the back of my head. i have done that before and if that is what i need to do again, ok, but i wondered if there is a common / best practices approach since a lot of people must have done that already. other frameworks give you the opportunity to simply register for touch events and i think that would make it alot easier…
any input welcome, thx


Register with the touch handler — great example is CCMenu and it’s children.

Our touch capturing stuff for Sprites, Nodes, etc is a simple register and forget.

I think best practice is to look at the awesome cross platform API in CC2d-x and decide the best way to use it for your game.

If you want register and forget, adopt CCMenu or build your own version.