Example #1
0
CCLayer::~CCLayer()
{
#if ND_MOD
	DEC_CCOBJ("CCLayer");
#endif
    unregisterScriptTouchHandler();
}
Example #2
0
void CCLayer::onExit()
{
	if( m_bIsTouchEnabled )
	{
		CCTouchDispatcher::sharedDispatcher()->removeDelegate(this);
        unregisterScriptTouchHandler();
	}

    // remove this layer from the delegates who concern Accelerometer Sensor
    if (m_bIsAccelerometerEnabled)
    {
        CCAccelerometer::sharedAccelerometer()->setDelegate(NULL);
    }

    // remove this layer from the delegates who concern the kaypad msg
    if (m_bIsKeypadEnabled)
    {
        CCKeypadDispatcher::sharedDispatcher()->removeDelegate(this);
    }

	CCNode::onExit();
}
Example #3
0
CCLayer::~CCLayer()
{
    unregisterScriptTouchHandler();
    unregisterScriptKeypadHandler();
    unregisterScriptAccelerateHandler();
}
Example #4
0
void CCLayer::registerScriptTouchHandler(int nHandler, bool bIsMultiTouches, int nPriority, bool bSwallowsTouches)
{
    unregisterScriptTouchHandler();
    m_pScriptTouchHandlerEntry = CCTouchScriptHandlerEntry::create(nHandler, bIsMultiTouches, nPriority, bSwallowsTouches);
    m_pScriptTouchHandlerEntry->retain();
}
Example #5
0
CCLayer::~CCLayer()
{
    unregisterScriptTouchHandler();
}
void CCLayer::registerScriptTouchHandler(ccScriptFunction nHandler)
{
    unregisterScriptTouchHandler();
    m_pScriptTouchHandlerEntry = CCTouchScriptHandlerEntry::create(nHandler);
    CC_SAFE_RETAIN(m_pScriptTouchHandlerEntry);
}