toBox function
A point in client px, such as an event's `clientX` and `clientY`, in px of `box` from its bottom left: the units of the shader's `box` times `u.size`.
import { toBox } from '@dioramajs/diorama/kit'. Pass input as the box in the update, since the page may scroll under a still pointer. Writes into out when given.
function toBox(
point: { readonly x: number; readonly y: number },
box: ClientBox,
out?: { x: number; y: number },
): { x: number; y: number }Parameters
| Name | Type | Description |
|---|---|---|
point | { readonly x: number; readonly y: number } | |
box | ClientBox | |
out? | { x: number; y: number } | Default |
Also exported from @dioramajs/effects/kit.
Defined in packages/effects/src/kit.ts.