Skip to main content

set 设置触摸点

set

类型: MethodDeclaration

所属类: TouchPoint

定义位置: event.ts

描述

设置触摸点

参数 touch: 原生触摸点

参数

参数名类型描述默认值
touchTouch--

返回值

类型: TouchPoint

源代码

位置: 第 1435 行

public set(touch: Touch): TouchPoint {
this.id = touch.identifier
const {x: screenX, y: screenY} = Mouse.convertClientToScreenCoords(touch.clientX, touch.clientY)
this.screenX = screenX
this.screenY = screenY
this.uiX = screenX / UI.scale
this.uiY = screenY / UI.scale
const {x: sceneX, y: sceneY} = Mouse.convertScreenToSceneCoords(screenX, screenY)
this.sceneX = sceneX
this.sceneY = sceneY
return this
}

文档生成时间:2025/7/7 12:07:06