quick touch事件 较原cocos2dx touch 事件优化了 很多,使用特别方面
我使用的时候发现 鼠标点击到 目标 NODE 上后,拖放到 NODE 外部后
释放点击 仍触发 ended 事件, 做稍微调整 Scene里的 事件改为 touch点移出
NODE的rect 时候 就触发 cancelled 事件
void CCScene::ccTouchesMoved(CCSet *pTouches, CCEvent *pEvent)
{
CCNode* node;
CCTouchTargetNode *touchTarget;
CCTouch *touch = NULL;
unsigned int count = m_touchingTargets->count();
for (unsigned int i = 0; i < count; ++i)
{
touchTarget = dynamic_cast<CCTouchTargetNode*>(m_touchingTargets->objectAtIndex(i));
node = touchTarget->getNode();
touch = touchTarget->findTouch(pTouches);
const CCPoint touchPoint = touch->getLocation();
const CCRect boundingBox = node->getCascadeBoundingBox();
if (!boundingBox.containsPoint(touchPoint))
{
node->ccTouchCancelled(touch, pEvent);
m_touchingTargets->removeObjectAtIndex(i);
continue;
}
}
dispatchingTouchEvent(pTouches, pEvent, CCTOUCHMOVED);
}