@uid4o wrote:
Hi there,
I'm having two partially overlapping sprites, each having its own eventListenerTouchOneByOne with fixed priority set to PositionY and setSwallowTouch(false) and I need to stop the second sprite from executing onTouchEnded. So I've decided to stopPropagation of the event in the onTouchEnded method and check with isStopped if the event is stopped from propagation but isStopped() keep returning false?
myListener = EventListenerTouchOneByOne::create(); myListener->setSwallowTouches(false); myListener->onTouchBegan = [&](Touch *touch, Event *event) { ..... }; myListener->onTouchMoved = [&](Touch *touch, Event *event) { .... }; myListener->onTouchEnded = [&](Touch *touch, Event *event) { if(!event->isStopped()) { ...... event->stopPropagation(); } else { ...... } }; Director::getInstance()->getEventDispatcher()->addEventListenerWithFixedPriority(myListener, this->getPositionY());
Posts: 1
Participants: 1