Touch 类型
模块: cc
封装了触摸相关的信息。
索引
方法
getLocation获取当前触点位置。getLocationX获取当前触点 X 轴位置。getLocationY获取当前触点 Y 轴位置。getPreviousLocation获取触点在上一次事件时的位置对象,对象包含 x 和 y 属性。getStartLocation获取触点落下时的位置对象,对象包含 x 和 y 属性。getDelta获取触点距离上一次事件移动的距离对象,对象包含 x 和 y 属性。getLocationInView获取当前事件在游戏窗口内的坐标位置对象,对象包含 x 和 y 属性。getPreviousLocationInView获取触点在上一次事件时在游戏窗口中的位置对象,对象包含 x 和 y 属性。getStartLocationInView获取触点落下时在游戏窗口中的位置对象,对象包含 x 和 y 属性。getID触点的标识 ID,可以用来在多点触摸中跟踪触点。setTouchInfo设置触摸相关的信息。
Details
方法
getLocation
获取当前触点位置。
| meta | description |
|---|---|
| 返回 | Vec2 |
| 定义于 | cocos2d/core/event-manager/CCTouch.js:45 |
getLocationX
获取当前触点 X 轴位置。
| meta | description |
|---|---|
| 返回 | Number |
| 定义于 | cocos2d/core/event-manager/CCTouch.js:55 |
getLocationY
获取当前触点 Y 轴位置。
| meta | description |
|---|---|
| 返回 | Number |
| 定义于 | cocos2d/core/event-manager/CCTouch.js:65 |
getPreviousLocation
获取触点在上一次事件时的位置对象,对象包含 x 和 y 属性。
| meta | description |
|---|---|
| 返回 | Vec2 |
| 定义于 | cocos2d/core/event-manager/CCTouch.js:75 |
getStartLocation
获取触点落下时的位置对象,对象包含 x 和 y 属性。
| meta | description |
|---|---|
| 返回 | Vec2 |
| 定义于 | cocos2d/core/event-manager/CCTouch.js:85 |
getDelta
获取触点距离上一次事件移动的距离对象,对象包含 x 和 y 属性。
| meta | description |
|---|---|
| 返回 | Vec2 |
| 定义于 | cocos2d/core/event-manager/CCTouch.js:95 |
getLocationInView
获取当前事件在游戏窗口内的坐标位置对象,对象包含 x 和 y 属性。
| meta | description |
|---|---|
| 返回 | Vec2 |
| 定义于 | cocos2d/core/event-manager/CCTouch.js:105 |
getPreviousLocationInView
获取触点在上一次事件时在游戏窗口中的位置对象,对象包含 x 和 y 属性。
| meta | description |
|---|---|
| 返回 | Vec2 |
| 定义于 | cocos2d/core/event-manager/CCTouch.js:115 |
getStartLocationInView
获取触点落下时在游戏窗口中的位置对象,对象包含 x 和 y 属性。
| meta | description |
|---|---|
| 返回 | Vec2 |
| 定义于 | cocos2d/core/event-manager/CCTouch.js:125 |
getID
触点的标识 ID,可以用来在多点触摸中跟踪触点。
| meta | description |
|---|---|
| 返回 | Number |
| 定义于 | cocos2d/core/event-manager/CCTouch.js:135 |
setTouchInfo
设置触摸相关的信息。用于监控触摸事件。
| meta | description |
|---|---|
| 定义于 | cocos2d/core/event-manager/CCTouch.js:145 |