CCLayer中什么时候会调用下面的四个函数,
virtual bool ccTouchBegan(CCTouch *pTouch, CCEvent *pEvent);
virtual void ccTouchMoved(CCTouch *pTouch, CCEvent *pEvent);virtual void ccTouchEnded(CCTouch *pTouch, CCEvent *pEvent);
virtual void ccTouchCancelled(CCTouch *pTouch, CCEvent *pEvent);
// default implements are used to call script callback if exist
virtual void ccTouchesBegan(CCSet *pTouches, CCEvent *pEvent);
virtual void ccTouchesMoved(CCSet *pTouches, CCEvent *pEvent);
virtual void ccTouchesEnded(CCSet *pTouches, CCEvent *pEvent);
virtual void ccTouchesCancelled(CCSet *pTouches, CCEvent *pEvent);
cclayer里面的ccTouchBegan和ccTouchesBegan到底调用哪个?
添加下面的代码:CCDirector::sharedDirector()->getTouchDispatcher()->addTargetedDelegate(this, 0, true);就调用的是ccTouchBegan,
不添加就调用ccTouchesBegan,而且ccTouchBegan里面返回true,触摸事件就会继续往下传递
默认的调用是调用ccTouchesBegan