前端之家收集整理的这篇文章主要介绍了
Cocos2d触摸:多点触摸,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
// 多点触摸 Size visibleSize = Director::getInstance()->getVisibleSize(); auto label LabelcreateWithSystemFont("多点触摸demo", "" 24); label->setPosition(Vec2(visibleSize.width/2height));thisaddChildlabel1100 listener EventListenerTouchAllAtOncecreate listeneronTouchesBegan [&](const std::vector<Touch*>& touchs Event* event){ label1 (Label*) getChildByTag(for(&touch: finger touchgetID()+; label1setString"按下去"+Valuefinger).asString"根手指^^" } }; _eventDispatcheraddEventListenerWithSceneGraPHPrioritylistener);