Class CCTouchDispatcher

#include <Geode/cocos/touch_dispatcher/CCTouchDispatcher.h>
classCCTouchDispatcher:publiccocos2d::CCObject,publiccocos2d::EGLTouchDelegate{ ... }

Since v0.8.0

CCTouchDispatcher. Singleton that handles all the touch events. The dispatcher dispatches events to the registered TouchHandlers. There are 2 different type of touch handlers:

  • Standard Touch Handlers
  • Targeted Touch Handlers The Standard Touch Handlers work like the CocoaTouch touch handler: a set of touches is passed to the delegate. On the other hand, the Targeted Touch Handlers only receive 1 touch at the time, and they can “swallow” touches (avoid the propagation of the event). Firstly, the dispatcher sends the received touches to the targeted touches. These touches can be swallowed by the Targeted Touch Handlers. If there are still remaining touches, then the remaining touches will be sent to the Standard Touch Handlers.
Examples0
Public static methods1
staticcocos2d::CCTouchDispatcher*get()
No description provided
Public member functions22
boolinit()
No description provided
boolisDispatchEvents()

Whether or not the events are going to be dispatched. Default: true

voidsetDispatchEvents(
boolbDispatchEvents
)
No description provided
voidaddStandardDelegate(,
intnPriority
)

Adds a standard touch delegate to the dispatcher’s list. See StandardTouchDelegate description. IMPORTANT: The delegate will be retained.

voidaddTargetedDelegate(,
intnPriority
,
boolbSwallowsTouches
)

Adds a targeted touch delegate to the dispatcher’s list. See TargetedTouchDelegate description. IMPORTANT: The delegate will be retained.

voidremoveDelegate()

Removes a touch delegate. The delegate will be released

voidremoveAllDelegates()

Removes all touch delegates, releasing all the delegates

voidsetPriority(
intnPriority
,)

Changes the priority of a previously added delegate. The lower the number, the higher the priority

voidtouches(,,
uintuIndex
)
No description provided
virtualvoidtouchesBegan(,)
No description provided
virtualvoidtouchesMoved(,)
No description provided
virtualvoidtouchesEnded(,)
No description provided
virtualvoidtouchesCancelled(,)
No description provided
cocos2d::CCTouchHandler*findHandler()
No description provided
voidaddPrioTargetedDelegate(,,)
No description provided
boolisUsingForcePrio()
No description provided
voidregisterForcePrio(,)
No description provided
voidunregisterForcePrio()
No description provided
intgetForcePrio()const
No description provided
voidsetForcePrio(
intvar
)
No description provided
intgetTargetPrio()const
No description provided
voidsetTargetPrio(
intvar
)
No description provided
Fields11
cocos2d::CCArray*m_pTargetedHandlers
;
No description provided
cocos2d::CCArray*m_pStandardHandlers
;
No description provided
boolm_bLocked
;
No description provided
boolm_bToAdd
;
No description provided
boolm_bToRemove
;
No description provided
cocos2d::CCArray*m_pHandlersToAdd
;
No description provided
cocos2d::_ccCArray*m_pHandlersToRemove
;
No description provided
boolm_bToQuit
;
No description provided
boolm_bDispatchEvents
;
No description provided
;
No description provided
void*m_unknown
;
No description provided
Protected member functions5
voidforceRemoveDelegate()
No description provided
voidforceAddHandler(,)
No description provided
voidforceRemoveAllDelegates()
No description provided
voidrearrangeHandlers()
No description provided
cocos2d::CCTouchHandler*findHandler(,)
No description provided
Protected fields2
intm_forcePrio
;
No description provided
intm_targetPrio
;
No description provided