Skip to main content

setTarget 设置目标元素

setTarget

类型: MethodDeclaration

所属类: ScriptTouchEvent

定义位置: event.ts

描述

设置目标元素

参数 event: 脚本触摸事件

参数 touch: 触摸点

参数 target: 目标元素

参数

参数名类型描述默认值
eventScriptTouchEvent--
touchTouchPoint--
targetUIElement | null--

返回值

类型: void

源代码

位置: 第 1445 行

public static setTarget(event: ScriptTouchEvent, touch: TouchPoint, target: UIElement | null): void {
event.target = target
ScriptTouchEvent.idToTargetMap.set(touch.id, target)
const idList = ScriptTouchEvent.targetToIdListMap.get(target)
if (idList instanceof Array) {
idList.append(touch.id)
} else {
ScriptTouchEvent.targetToIdListMap.set(target, [touch.id])
}
}

文档生成时间:2026/2/1 16:51:39