cocos2d-x之多点触摸事件

cocos2d-x之多点触摸事件

 1 //全部所有的触摸点一起触发
 2     auto listener = EventListenerTouchAllAtOnce::create();
 3     
 4     listener->onTouchesBegan = [](std::vector<Touch*> ts, Event *e){
 5         log("onTouchesBegan");
 6     };
 7     
 8     //获得触摸点的数量
 9     listener->onTouchesMoved = [](std::vector<Touch*> ts,Event *e){
10         log("touches moved,and touch count is %ld", ts.size());
11     };
12     
13     //this代表,使用的是当前的层作为节点
14     Director::getInstance()->getEventDispatcher()->addEventListenerWithSceneGraphPriority(listener, this);

 

posted @ 2015-03-29 09:44  silent-bobo  阅读(529)  评论(0编辑  收藏  举报