• Touch 类型
    • 索引
      • 方法
  • Details
    • 方法
      • getLocation
      • getLocationX
      • getLocationY
      • getPreviousLocation
      • getStartLocation
      • getDelta
      • getLocationInView
      • getPreviousLocationInView
      • getStartLocationInView
      • getID
      • setTouchInfo
        • 参数列表

    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

    获取当前触点位置。

    metadescription
    返回Vec2
    定义于cocos2d/core/event-manager/CCTouch.js:45
    getLocationX

    获取当前触点 X 轴位置。

    metadescription
    返回Number
    定义于cocos2d/core/event-manager/CCTouch.js:55
    getLocationY

    获取当前触点 Y 轴位置。

    metadescription
    返回Number
    定义于cocos2d/core/event-manager/CCTouch.js:65
    getPreviousLocation

    获取触点在上一次事件时的位置对象,对象包含 x 和 y 属性。

    metadescription
    返回Vec2
    定义于cocos2d/core/event-manager/CCTouch.js:75
    getStartLocation

    获获取触点落下时的位置对象,对象包含 x 和 y 属性。

    metadescription
    返回Vec2
    定义于cocos2d/core/event-manager/CCTouch.js:85
    getDelta

    获取触点距离上一次事件移动的距离对象,对象包含 x 和 y 属性。

    metadescription
    返回Vec2
    定义于cocos2d/core/event-manager/CCTouch.js:95
    getLocationInView

    获取当前事件在游戏窗口内的坐标位置对象,对象包含 x 和 y 属性。

    metadescription
    返回Vec2
    定义于cocos2d/core/event-manager/CCTouch.js:105
    getPreviousLocationInView

    获取触点在上一次事件时在游戏窗口中的位置对象,对象包含 x 和 y 属性。

    metadescription
    返回Vec2
    定义于cocos2d/core/event-manager/CCTouch.js:115
    getStartLocationInView

    获取触点落下时在游戏窗口中的位置对象,对象包含 x 和 y 属性。

    metadescription
    返回Vec2
    定义于cocos2d/core/event-manager/CCTouch.js:125
    getID

    触点的标识 ID,可以用来在多点触摸中跟踪触点。

    metadescription
    返回Number
    定义于cocos2d/core/event-manager/CCTouch.js:135
    setTouchInfo

    设置触摸相关的信息。用于监控触摸事件。

    metadescription
    定义于cocos2d/core/event-manager/CCTouch.js:145
    参数列表
    • id Number
    • x Number
    • y Number