cocos2d-x节点(CCEventTouch.h)API
2013-12-04 09:03
387 查看
本文来自http://blog.csdn.net/runaying ,引用必须注明出处!
温馨提醒:为了大家能更好学习,强烈推荐大家看看本人的这篇博客 Cocos2d-X权威指南笔记
触摸事件
cocos2d-x节点(CCEventTouch.h)API
温馨提醒:为了大家能更好学习,强烈推荐大家看看本人的这篇博客 Cocos2d-X权威指南笔记触摸事件
///cocos2d/cocos2d-x-3.0alpha0/cocos2dx/event_dispatcher //触摸事件 #ifndef __cocos2d_libs__TouchEvent__ #define __cocos2d_libs__TouchEvent__ #include "CCEvent.h" #include "event_dispatcher/CCTouch.h" #include <vector> NS_CC_BEGIN #define TOUCH_PERF_DEBUG 1 class EventTouch : public Event { public: static const char* EVENT_TYPE; static const int MAX_TOUCHES = 5; enum class EventCode { BEGAN, MOVED, ENDED, CANCELLED }; EventTouch() : Event(EVENT_TYPE) { _touches.reserve(MAX_TOUCHES); } EventCode getEventCode() { return _eventCode; }; std::vector<Touch*> getTouches() { return _touches; }; #if TOUCH_PERF_DEBUG void setEventCode(EventCode eventCode) { _eventCode = eventCode; }; void setTouches(const std::vector<Touch*>& touches) { _touches = touches; }; #endif private: EventCode _eventCode; std::vector<Touch*> _touches; friend class EGLViewProtocol; }; NS_CC_END #endif /* defined(__cocos2d_libs__TouchEvent__) */
相关文章推荐
- cocos2d-x节点(CCEventListenerTouch.h)API
- cocos2d-x节点(CCEventType.h)API
- cocos2d-x节点(CCEvent.h)API
- cocos2d-x节点(CCEventListener.h)API
- cocos2d-x节点(CCEventDispatcher.h)API
- cocos2d-x节点(CCEventCustom.h)API
- cocos2d-x节点(CCEventListenerKeyboard.h)API
- cocos2d-x节点(CCEventListenerCustom.h)API
- cocos2d-x节点(CCEventListenerAcceleration.h)API
- cocos2d-x节点(CCEventKeyboard.h)API
- cocos2d-x节点(CCEventAcceleration.h)API
- cocos2d-x节点(CCGLProgram.h)API
- cocos2d-x节点(CCCommon.h)API
- cocos2d-x节点(CCPhysicsContact.h)API
- cocos2d-x节点(CCTransitionPageTurn.h)API
- cocos2d-x节点(CCDeprecated.h)API
- cocos2d-x节点(CCActionInstant.h)API
- COcos2d-X 节点(CCConfiguration.h)API
- cocos2d-x节点(CCShaderCache.h)API
- cocos2d-x节点(CCPhysicsShape.h)API