标签:
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;
}
标签:
原文地址:http://www.cnblogs.com/daochong/p/5229153.html