1、首先要确定自己使用的触摸事件,有OnTouchBegan等;
2、定义触摸事件方法;
3、注册触摸事件;
auto listener=EventListenerTouchOneByOne::create();
listener->onTouchBegan=CC_CALLBACK_2(HelloWorld::onTouchBegan,this);
_eventDispatcher->addEventListenerWithSceneGraPHPriority(listener,this);