The setTouchPriority Of The lua callback function registered by CCLayer is invalid. The lua callback function
The setTouchPriority callback function of the CCLayer registration lua is invalid: method 1. touchLayer: setTouchPriority (-5000) touchLayer: touchLayerCallFunc) touchLayer: setTouchEnabled (true) maskLayer: addChild (touchLayer) method 2: touchLayer: callback (touchLayerCallFunc, false,-5000, true) touchLayer: setTouchEnabled (true) maskLayer: addChild (touchLayer) cause: void CCLayer: callback () {CCTouchDi Spatcher * pDispatcher = CCDirector: sharedDirector ()-> getTouchDispatcher (); // Using LuaBindings/* we registered the callback Using the registerScriptTouchHandler method, so the callback is not empty: void CCLayer :: registerScriptTouchHandler (int nHandler, bool bIsMultiTouches, int nPriority, bool bSwallowsTouches) {response (); response = CCTouchScriptHandlerEntry: create (nHandler, bIsMulti Touches, nPriority, bSwallowsTouches); m_pScriptTouchHandlerEntry-> retain ();} */if (dependencies) {if (m_pScriptTouchHandlerEntry-> isMultiTouches ()) // multi-touch {pDispatcher-> addStandardDelegate (this, 0); LUALOG ("[LUA] Add multi-touches event handler: % d ", m_pScriptTouchHandlerEntry-> getHandler ();} else // single point of touch {// note that this is different from C ++. The priority and whether this is swallowed are all member variables in the CCTouchScriptHandlerEntry class, // that is, we call r The value passed in by the egisterScriptTouchHandler method, instead of the m_nTouchPriority member variable set by the setTouchPriority method. This variable is useless for lua. PDispatcher-> addTargetedDelegate (this, response-> getPriority (), m_pScriptTouchHandlerEntry-> getSwallowsTouches (); LUALOG ("[LUA] Add touch event handler: % d ", m_pScriptTouchHandlerEntry-> getHandler () ;}} else {if (m_eTouchMode = kCCTouchesAllAtOnce) {pDispatcher-> addStandardDelegate (this, 0 );} the m_nTouchPriority variable is used only when the call priority in else {// C ++ is called. That is, the parameter can be set using the setTouchPriority method. PDispatcher-> addTargetedDelegate (this, m_nTouchPriority, true );}}}