白猪掌柜的
LayerColor *GameStopSprite::createNoTouchLayer(){auto noTouchLayer = LayerColor::create(Color4B(255, 0, 0, 100));auto listener = EventListenerTouchOneByOne::create();listener->setSwallowTouches(true);listener->onTouchBegan = [](Touch *touch, Event *event){log("pressed.......");return false;};Director::getInstance()->getEventDispatcher()->addEventListenerWithFixedPriority(listener, -130); //第1句Director::getInstance()->getEventDispatcher()->addEventListenerWithSceneGraphPriority(listener, noTouchLayer); //第2句return noTouchLayer;}