Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Touch

封装了触点相关的信息。

Hierarchy

  • Touch

Index

Constructors

constructor

  • newTouch(x: number, y: number, id?: number): Touch

Properties

Private _id

_id: number = 0

Private _lastModified

_lastModified: number = 0

Private _point

_point: Vec2 = new Vec2()

Private _prevPoint

_prevPoint: Vec2 = new Vec2()

Private _startPoint

_startPoint: Vec2 = new Vec2()

Private _startPointCaptured

_startPointCaptured: boolean = false

Accessors

lastModified

  • get lastModified(): number

Methods

getDelta

getID

  • getID(): number

getLocation

getLocationInView

getLocationX

  • getLocationX(): number

getLocationY

  • getLocationY(): number

getPreviousLocation

getPreviousLocationInView

  • getPreviousLocationInView(out?: Vec2): Vec2

getStartLocation

getStartLocationInView

  • getStartLocationInView(out?: Vec2): Vec2

getUIDelta

  • 获取触点距离上一次事件移动在 UI 坐标系中的距离对象,对象包含 x 和 y 属性。

    Parameters

    • Optional out: Vec2

      Pass the out object to avoid object creation, very good practice

    Returns Vec2

getUILocation

getUILocationX

  • getUILocationX(): number

getUILocationY

  • getUILocationY(): number

getUIPreviousLocation

  • getUIPreviousLocation(out?: Vec2): Vec2

getUIStartLocation

setPoint

  • setPoint(point: Vec2): void
  • setPoint(x: number, y: number): void

setPrevPoint

  • setPrevPoint(point: Vec2): void
  • setPrevPoint(x: number, y: number): void

setTouchInfo

  • setTouchInfo(id?: number, x?: undefined | number, y?: undefined | number): void
  • 重置触点相关的信息。

    Parameters

    • Default value id: number = 0

      The id of the touch point

    • Optional x: undefined | number

      x position of the touch point

    • Optional y: undefined | number

      y position of the touch point

    Returns void

Generated using TypeDoc