Пример #1
0
void Layer::registerWithTouchDispatcher()
{
    TouchDispatcher* pDispatcher = Director::getInstance()->getTouchDispatcher();

    if( _touchMode == Touch::DispatchMode::ALL_AT_ONCE ) {
        pDispatcher->addStandardDelegate(this, 0);
    } else {
        pDispatcher->addTargetedDelegate(this, _touchPriority, _swallowsTouches);
    }
}
Пример #2
0
void Layer::registerWithTouchDispatcher()
{
    TouchDispatcher* pDispatcher = Director::getInstance()->getTouchDispatcher();

    if( _touchMode == kTouchesAllAtOnce ) {
        pDispatcher->addStandardDelegate(this, 0);
    } else {
        pDispatcher->addTargetedDelegate(this, _touchPriority, true);
    }
}