cocos2d-x之多点触碰初试
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了cocos2d-x之多点触碰初试相关的知识,希望对你有一定的参考价值。
bool HelloWorld::init()
{
if ( !Layer::init() )
{
return false;
}
Size visibleSize = Director::getInstance()->getVisibleSize();
auto listener=EventListenerTouchAllAtOnce::create();
listener->onTouchesBegan=[](std::vector<Touch*> ts,Event *e){
log("onTouchesBegan");
};
listener->onTouchesMoved=[](std::vector<Touch*> ts,Event *e){
log("touches moved,and touch count is %ld",ts.size());
};
Director::getInstance()->getEventDispatcher()->addEventListenerWithSceneGraphpriority(listener,this);
return true;
}
以上是关于cocos2d-x之多点触碰初试的主要内容,如果未能解决你的问题,请参考以下文章