|
cocos2d-x
2.1.1
|
#include <CCTouchDispatcher.h>
Public Member Functions | |
| ~CCTouchDispatcher () | |
| bool | init (void) |
| CCTouchDispatcher () | |
| bool | isDispatchEvents (void) |
| Whether or not the events are going to be dispatched. | |
| void | setDispatchEvents (bool bDispatchEvents) |
| void | addStandardDelegate (CCTouchDelegate *pDelegate, int nPriority) |
| Adds a standard touch delegate to the dispatcher's list. | |
| void | addTargetedDelegate (CCTouchDelegate *pDelegate, int nPriority, bool bSwallowsTouches) |
| Adds a targeted touch delegate to the dispatcher's list. | |
| void | removeDelegate (CCTouchDelegate *pDelegate) |
| Removes a touch delegate. | |
| void | removeAllDelegates (void) |
| Removes all touch delegates, releasing all the delegates. | |
| void | setPriority (int nPriority, CCTouchDelegate *pDelegate) |
| Changes the priority of a previously added delegate. | |
| void | touches (CCSet *pTouches, CCEvent *pEvent, unsigned int uIndex) |
| virtual void | touchesBegan (CCSet *touches, CCEvent *pEvent) |
| virtual void | touchesMoved (CCSet *touches, CCEvent *pEvent) |
| virtual void | touchesEnded (CCSet *touches, CCEvent *pEvent) |
| virtual void | touchesCancelled (CCSet *touches, CCEvent *pEvent) |
| CCTouchHandler * | findHandler (CCTouchDelegate *pDelegate) |
Public Member Functions inherited from CCObject | |
| CCObject (void) | |
| virtual | ~CCObject (void) |
| void | release (void) |
| void | retain (void) |
| CCObject * | autorelease (void) |
| CCObject * | copy (void) |
| bool | isSingleReference (void) |
| unsigned int | retainCount (void) |
| virtual bool | isEqual (const CCObject *pObject) |
| virtual void | update (float dt) |
Public Member Functions inherited from CCCopying | |
| virtual CCObject * | copyWithZone (CCZone *pZone) |
Public Member Functions inherited from EGLTouchDelegate | |
| virtual | ~EGLTouchDelegate () |
Protected Member Functions | |
| void | forceRemoveDelegate (CCTouchDelegate *pDelegate) |
| void | forceAddHandler (CCTouchHandler *pHandler, CCArray *pArray) |
| void | forceRemoveAllDelegates (void) |
| void | rearrangeHandlers (CCArray *pArray) |
| CCTouchHandler * | findHandler (CCArray *pArray, CCTouchDelegate *pDelegate) |
Protected Attributes | |
| CCArray * | m_pTargetedHandlers |
| CCArray * | m_pStandardHandlers |
| bool | m_bLocked |
| bool | m_bToAdd |
| bool | m_bToRemove |
| CCArray * | m_pHandlersToAdd |
| struct _ccCArray * | m_pHandlersToRemove |
| bool | m_bToQuit |
| bool | m_bDispatchEvents |
| struct ccTouchHandlerHelperData | m_sHandlerHelperData [ccTouchMax] |
Protected Attributes inherited from CCObject | |
| unsigned int | m_uReference |
| unsigned int | m_uAutoReleaseCount |
Additional Inherited Members | |
Public Attributes inherited from CCObject | |
| unsigned int | m_uID |
| int | m_nLuaID |
Detailed Description
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.
- Since
- v0.8.0
Constructor & Destructor Documentation
| ~CCTouchDispatcher | ( | ) |
|
inline |
Member Function Documentation
| void addStandardDelegate | ( | CCTouchDelegate * | pDelegate, |
| int | nPriority | ||
| ) |
Adds a standard touch delegate to the dispatcher's list.
See StandardTouchDelegate description. IMPORTANT: The delegate will be retained.
| void addTargetedDelegate | ( | CCTouchDelegate * | pDelegate, |
| int | nPriority, | ||
| bool | bSwallowsTouches | ||
| ) |
Adds a targeted touch delegate to the dispatcher's list.
See TargetedTouchDelegate description. IMPORTANT: The delegate will be retained.
| CCTouchHandler* findHandler | ( | CCTouchDelegate * | pDelegate | ) |
|
protected |
|
protected |
|
protected |
|
protected |
| bool init | ( | void | ) |
| bool isDispatchEvents | ( | void | ) |
Whether or not the events are going to be dispatched.
Default: true
|
protected |
| void removeAllDelegates | ( | void | ) |
Removes all touch delegates, releasing all the delegates.
| void removeDelegate | ( | CCTouchDelegate * | pDelegate | ) |
Removes a touch delegate.
The delegate will be released
| void setDispatchEvents | ( | bool | bDispatchEvents | ) |
| void setPriority | ( | int | nPriority, |
| CCTouchDelegate * | pDelegate | ||
| ) |
Changes the priority of a previously added delegate.
The lower the number, the higher the priority
Implements EGLTouchDelegate.
Implements EGLTouchDelegate.
Implements EGLTouchDelegate.
Implements EGLTouchDelegate.
Member Data Documentation
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
The documentation for this class was generated from the following file:
- /Users/zhangkoumyou/SourceCode/cocos2d-x/cocos2dx/touch_dispatcher/CCTouchDispatcher.h

Public Member Functions inherited from 