cocos2dx 点击事件分析(1)
来源:互联网 发布:高德软件股票行情 编辑:程序博客网 时间:2024/04/30 10:32
CCTouch类是每个点击事件处理过程中,都需要使用的类,因为android的屏幕坐标和OpenGL的坐标的不同,而且在屏幕适配时,有缩放,所以需要把屏幕坐标转化为OpenGL的坐标坐标。class CC_DLL CCTouch : public CCObject{public: /** * @js ctor */ CCTouch() : m_nId(0), m_startPointCaptured(false) {} /** returns the current touch location in OpenGL coordinates */ CCPoint getLocation() const; /** returns the previous touch location in OpenGL coordinates */ CCPoint getPreviousLocation() const; /** returns the start touch location in OpenGL coordinates */ CCPoint getStartLocation() const; /** returns the delta of 2 current touches locations in screen coordinates */ CCPoint getDelta() const; /** returns the current touch location in screen coordinates */ CCPoint getLocationInView() const; /** returns the previous touch location in screen coordinates */ CCPoint getPreviousLocationInView() const; /** returns the start touch location in screen coordinates */ CCPoint getStartLocationInView() const; void setTouchInfo(int id, float x, float y) { m_nId = id; m_prevPoint = m_point; m_point.x = x; m_point.y = y; if (!m_startPointCaptured) { m_startPoint = m_point; m_startPointCaptured = true; } } /** * @js getId */ int getID() const { return m_nId; }private: int m_nId; bool m_startPointCaptured; CCPoint m_startPoint; CCPoint m_point; CCPoint m_prevPoint;};
0 0
- cocos2dx 点击事件分析(1)
- cocos2dx 点击事件分析(2)
- cocos2dx 点击事件分析(3)
- cocos2dx 点击事件分析(4)
- cocos2dx 点击事件分析(5)
- cocos2dx 精灵点击事件
- 按钮点击事件cocos2dx
- 在cocos2dx中的点击事件
- cocos2dx 3.0调用点击事件
- cocos2DX-lua 点击事件封装
- cocos2dx点击事件的分发问题
- Cocos2dx学习笔记(二)、点击事件
- cocos2dx中的label可点击事件
- cocos2dx-3.X中对事件处理分析(1)
- 详细解析cocos2dx 3.x的事件中的点击事件
- 关于点击事件的分析
- cocos2dx源码分析:事件监听器EventListener
- cocos2dx源码分析:事件派发器EventDispatcher
- java 容器深入研究之使用Abstract类定制
- 查找maven中的groupId,artifactId,version等信息的方式
- Servlet 3.0 新特性详解(五)ServletContext 的性能增强及HttpServletRequest 对文件上传的支持
- 04 多线程
- 博客园学习网站
- cocos2dx 点击事件分析(1)
- C语言中函数的思考(可以返回局部变量吗)
- 郝斌数据结构教学视频下载地址
- iOS应用安全Part4:使用Cycript进行运行时分析
- 深入解读Tomcat(四)
- 第三周项目5-5:多文件组织
- KVC 和 KVO 的一点理解
- Codeforces Round #297 (Div. 2)——B. Pasha and String
- 心情记录