Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Touch

封装了触摸相关的信息。

class

Touch

param
param
param

Hierarchy

  • Touch

Index

Constructors

constructor

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

Properties

Private _id

_id: number | null = null

_lastModified

_lastModified: number = 0

_point

_point: Vec2 = new Vec2()

_prevPoint

_prevPoint: Vec2 = new Vec2()

Private _startPoint

_startPoint: Vec2 = new Vec2()

Private _startPointCaptured

_startPointCaptured: boolean = false

Methods

setPoint

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

setPrevPoint

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

getDelta

getID

  • getID(): null | number

getLocation

getLocationInView

getLocationX

  • getLocationX(): number

getLocationY

  • getLocationY(): number

getPreviousLocation

getPreviousLocationInView

  • getPreviousLocationInView(out?: Vec2): Vec2

getStartLocation

getStartLocationInView

  • getStartLocationInView(out?: Vec2): Vec2

getUIDelta

getUILocation

getUILocationX

  • getUILocationX(): number

getUILocationY

  • getUILocationY(): number

getUIPreviousLocation

  • getUIPreviousLocation(out?: Vec2): Vec2

getUIStartLocation

setTouchInfo

  • setTouchInfo(id?: number | null, x?: undefined | number, y?: undefined | number): void
  • 设置触摸相关的信息。用于监控触摸事件。

    Parameters

    • Default value id: number | null = null
    • Optional x: undefined | number
    • Optional y: undefined | number

    Returns void

Generated using TypeDoc