I am trying to implement multitouches. I have the touch listener set up in the init() of the layer class as follows
setTouchEnabled(true); //but this function has been declared deprecated anyway
setTouchMode(Touch::DispatchMode::ALL_AT_ONCE);
auto dispatcher = Director::getInstance()->getEventDispatcher();
auto touchListener = EventListenerTouchAllAtOnce::create();
touchListener->onTouchesBegan = CC_CALLBACK_2(TerrainLayer::onTouchesBegan, this);
dispatcher->addEventListenerWithSceneGraphPriority(touchListener, this);
Wait… wont it store all the touches from the WHOLE game… like in the end wont _touches contain like 1000+ touches? I want something that returns 5 when I touch with all my fingers, or 3 when I touch with 3 fingers at one time. In my opinion Your method does not do that… or I am missing something