Пример #1
0
void CCLayer::registerWithTouchDispatcher()
{
    CCTouchDispatcher* pDispatcher = CCDirector::sharedDirector()->getTouchDispatcher();

    // Using LuaBindings
    if (m_pScriptTouchHandlerEntry)
    {
        if (m_pScriptTouchHandlerEntry->isMultiTouches())
        {
            pDispatcher->addStandardDelegate(this, 0);
            LUALOG("[LUA] Add multi-touches event handler: %d", m_pScriptTouchHandlerEntry->getHandler());
        }
        else
        {
            pDispatcher->addTargetedDelegate(this,
                                             m_pScriptTouchHandlerEntry->getPriority(),
                                             m_pScriptTouchHandlerEntry->getSwallowsTouches());
            LUALOG("[LUA] Add touch event handler: %d", m_pScriptTouchHandlerEntry->getHandler());
        }
    }
    else
    {
        if( m_eTouchMode == kCCTouchesAllAtOnce ) {
            pDispatcher->addStandardDelegate(this, 0);
        } else {
            pDispatcher->addTargetedDelegate(this, m_nTouchPriority, true);
        }
    }
}
Пример #2
0
void CCLayer::registerWithTouchDispatcher()
{
    CCTouchDispatcher* pDispatcher = CCDirector::sharedDirector()->getTouchDispatcher();

    if( m_eTouchMode == kCCTouchesAllAtOnce ) {
        pDispatcher->addStandardDelegate(this, 0);
    } else {
        pDispatcher->addTargetedDelegate(this, m_nTouchPriority, m_bSwallowTouch);
    }
}
Пример #3
0
		void TouchComponent::registerWithTouchDispatcher( )
		{
			CCTouchDispatcher *pDispatcher = CCDirector::sharedDirector( )->getTouchDispatcher( );

			if ( _touchMode == ALL_AT_ONCE )
			{
				pDispatcher->addStandardDelegate( this, 0 );
			} else
			{
				pDispatcher->addTargetedDelegate( this, _touchPriority, _swallowsTouches );
			}
		}
Пример #4
0
void CCLayer::registerWithTouchDispatcher()
{
	CCTouchDispatcher* pDispatcher = CCDirector::sharedDirector()->getTouchDispatcher();

    if (m_pScriptHandlerEntry)
    {
        if (m_pScriptHandlerEntry->isMultiTouches())
        {
            pDispatcher->addStandardDelegate(this,0);
            LUALOG("[LUA] Add multi-touches event handler: %d", m_pScriptHandlerEntry->getHandler());
        }
        else
        {
            pDispatcher->addTargetedDelegate(this,
                                                                       m_pScriptHandlerEntry->getPriority(),
                                                                       m_pScriptHandlerEntry->getSwallowsTouches());
            LUALOG("[LUA] Add touch event handler: %d", m_pScriptHandlerEntry->getHandler());
        }
        return;
    }
	pDispatcher->addStandardDelegate(this,0);
}
Пример #5
0
void BBAbstractSceneView::registerWithTouchDispatcher()
{
	CCTouchDispatcher* pDispatcher = CCDirector::sharedDirector()->getTouchDispatcher();
	
	pDispatcher->addStandardDelegate(this, m_nTouchPriority);
}