fix issue that ControlButton can't swallow touch event.

This commit is contained in:
Ryeeeeee 2014-04-02 17:01:11 +08:00
parent b095d5ec5b
commit 432ec49c88
1 changed files with 1 additions and 0 deletions

View File

@ -75,6 +75,7 @@ bool Control::init()
auto dispatcher = Director::getInstance()->getEventDispatcher();
auto touchListener = EventListenerTouchOneByOne::create();
touchListener->setSwallowTouches(true);
touchListener->onTouchBegan = CC_CALLBACK_2(Control::onTouchBegan, this);
touchListener->onTouchMoved = CC_CALLBACK_2(Control::onTouchMoved, this);
touchListener->onTouchEnded = CC_CALLBACK_2(Control::onTouchEnded, this);