Help with touch event! [begginer doubt]

Help with touch event! [begginer doubt]
0.0 0



I started to use cocos-2dx 2 days ago, and im trying to understand some stuffs yet, but due the lack of documentation and tutorials on web, im having a lot of trouble to port my game to cocos2d-x.

Anyone have a good tutorial or documentation about touch event on cocosd-x/C++?

Im trying to make an action when someone click on one part or element of the screen.
I searched a lot on the web and on the cocos2d-x website and found nothing usefull.

Please, someone have some information to share please?


Test case in “Tests” are the best sample. You can refer to tests/TouchesTest.
In this sample, Paddle inherits from both CCSprite and CCTargetedTouchDelegate. As a touch delegate, you can implement ccTouchBegan/Moved/Ended() methods to receive the touch msgs.
And it register itself to touch dispatcher by
pDirector->getTouchDispatcher()->addTargetedDelegate(this 0, true) in Paddle::onEnter(), while unregister in onExit()