auto menu = Menu::create(item1, item2, NULL); menu->setPosition(Vec2(VisibleRect::center().x, VisibleRect::center().y - 120)); addChild(menu, 1); menu->setTouchPriority(Touch::DispatchMode::ONE_BY_ONE);In the above code snippet, a CCMenu object is created and positioned on the screen. The setTouchPriority() function is then called to set the touch event priority to Touch::DispatchMode::ONE_BY_ONE. Package library: cocos2d-x.