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;
}