The 2D layer · function

pointerTarget

Who should receive pointer input at this position.

Explained in Sprites and tilemaps.

function pointerTarget(state: PointerState, root: UiNode, x: number, y: number): UiNode | null
import { pointerTarget } from '@driftengine/ui2d';

Parameters

ParameterTypeDescription
statePointerState
rootUiNode
xnumber
ynumber

In depth

A captured node receives it wherever the pointer is, including outside the window. Otherwise it is an ordinary hit test — and while a drag is in progress, the result is remembered as the prospective drop target.