コード例 #1
0
ファイル: CCLayer.cpp プロジェクト: BetaS/cocos2d-x
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
ファイル: CCLayer.cpp プロジェクト: qiuxu/Cocos2dWindows
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
ファイル: BBAbstractSceneView.cpp プロジェクト: newcl/boom
void BBAbstractSceneView::registerWithTouchDispatcher()
{
	CCTouchDispatcher* pDispatcher = CCDirector::sharedDirector()->getTouchDispatcher();
	
	pDispatcher->addStandardDelegate(this, m_nTouchPriority);
}