Function: resolveCanvasPointerPosition()
resolveCanvasPointerPosition(
world,canvas,renderContext,pointerSource):Vector2|null
Defined in: ui/utilities/resolve-canvas-pointer-position.ts:30
Converts a pointer's current position - canvas pixels, Y-down - into
canvas's own UI world space, through its dedicated camera. Two canvases
with different cameras (e.g. different verticalWorldUnits) convert the
same pointer position differently, which is why this takes a specific
canvas rather than publishing one shared "the" UI world position.
Parameters
world
The ECS world canvas's camera entity belongs to.
canvas
The canvas to convert the pointer position for.
renderContext
The render context the canvas's camera renders through.
pointerSource
The pointer source to read the canvas-space position from.
Returns
Vector2 | null
The pointer position in canvas's UI world space, or null if
the canvas's camera entity is missing its CameraEcsComponent/
PositionEcsComponent.