Public Member Functions | Static Public Member Functions | Properties

CCTouchDispatcher Class Reference

#import <CCTouchDispatcher.h>

Inherits EAGLTouchDelegate-p.

List of all members.

Public Member Functions

(void) - addStandardDelegate:priority:
(void) - addTargetedDelegate:priority:swallowsTouches:
(void) - removeDelegate:
(void) - removeAllDelegates
(void) - setPriority:forDelegate:

Static Public Member Functions

(CCTouchDispatcher *) + sharedDispatcher

Properties

BOOL dispatchEvents

Detailed Description

CCTouchDispatcher. Singleton that handles all the touch events. The dispatcher dispatches events to the registered TouchHandlers. There are 2 different type of 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.

Since:
v0.8.0

Definition at line 72 of file CCTouchDispatcher.h.


Member Function Documentation

- (void) addStandardDelegate: (id< CCStandardTouchDelegate >)  delegate
priority: (int)  priority 

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

- (void) addTargetedDelegate: (id< CCTargetedTouchDelegate >)  delegate
priority: (int)  priority
swallowsTouches: (BOOL)  swallowsTouches 

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

- (void) removeAllDelegates  

Removes all touch delegates, releasing all the delegates

- (void) removeDelegate: (id)  delegate  

Removes a touch delegate. The delegate will be released

- (void) setPriority: (int)  priority
forDelegate: (id)  delegate 

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

+ (CCTouchDispatcher*) sharedDispatcher  

singleton of the CCTouchDispatcher


Property Documentation

- (BOOL) dispatchEvents [read, write, assign]

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

Definition at line 85 of file CCTouchDispatcher.h.


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Defines

cocos2d for iPhone 0.99.4 API Reference - Generated using Doxygen 1.7.1