CCTouchDispatcher Class Reference
Inherits from | NSObject |
Conforms to | CCTouchDelegate EAGLTouchDelegate |
Declared in | CCTouchDispatcher.h |
Overview
CCTouchDispatcher. Object 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.
Tasks
Other Methods
-
dispatchEvents
Whether or not the events are going to be dispatched. Default: YES
property -
– addStandardDelegate:priority:
Adds a standard touch delegate to the dispatcher’s list. See StandardTouchDelegate description. IMPORTANT: The delegate will be retained.
-
– addTargetedDelegate:priority:swallowsTouches:
Adds a targeted touch delegate to the dispatcher’s list. See TargetedTouchDelegate description. IMPORTANT: The delegate will be retained.
-
– removeDelegate:
Removes a touch delegate. The delegate will be released
-
– removeAllDelegates
Removes all touch delegates, releasing all the delegates
-
– setPriority:forDelegate:
Changes the priority of a previously added delegate. The lower the number, the higher the priority
Other Methods
-
+ sharedDispatcher
singleton of the CCTouchDispatcher
Instance Methods
addStandardDelegate:priority:
Adds a standard touch delegate to the dispatcher’s list. See StandardTouchDelegate description. IMPORTANT: The delegate will be retained.
- (void)addStandardDelegate:(id<CCTouchAllAtOnceDelegate>)delegate priority:(int)priority
Declared In
CCTouchDispatcher.h
addTargetedDelegate:priority:swallowsTouches:
Adds a targeted touch delegate to the dispatcher’s list. See TargetedTouchDelegate description. IMPORTANT: The delegate will be retained.
- (void)addTargetedDelegate:(id<CCTouchOneByOneDelegate>)delegate priority:(int)priority swallowsTouches:(BOOL)swallowsTouches
Declared In
CCTouchDispatcher.h
removeAllDelegates
Removes all touch delegates, releasing all the delegates
- (void)removeAllDelegates
Declared In
CCTouchDispatcher.h