嘿,我有简单的层,然后我有第二层,即弹出窗口
,当我创建弹出窗口时,当我触摸它时,它是层,触摸从最顶层渗透到它下面的层。
我怎么能防止它,所以当弹出窗口在顶部时,下面的所有层都是不可触摸的,这是弹出窗口中的触摸代码
void PopupLayerObj::onEnter()
{
Layer::onEnter();
auto listener = EventListenerTouchAllAtOnce::create();
listener->onTouchesBegan = CC_CALLBACK_2(PopupLayerObj::onTouchesBegan, this);
listener->onTouchesMoved = CC_CALLBACK_2(PopupLayerObj::onTouchesMoved, this);
listener->onTouchesEnded = CC_CALLBACK_2(PopupLayerObj::onTouchesEnded, this);
_eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this);
}