部分代码:
- auto touchListener = EventListenerTouchAllAtOnce::create();
- touchListener->onTouchesBegan = CC_CALLBACK_2(GameScene::onTouchesBegan, this);
- touchListener->onTouchesMoved = CC_CALLBACK_2(GameScene::onTouchesMoved, this);
- touchListener->onTouchesEnded = CC_CALLBACK_2(GameScene::onTouchesEnded, this);
- _eventDispatcher->addEventListenerWithSceneGraphPriority(touchListener, this);
…
void GameScene::onTouchesBegan(const std::vector<Touch*>& touches, Event* event)
{
CCLOG(“points count=%d”, (int)touches.size());
}
打印出来 android 只有一个touch。不知道怎么回事