# toBox

function in `@dioramajs/diorama/kit`

```ts
import { toBox } from '@dioramajs/diorama/kit'
```

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`. Pass `input` as the box in the
update, since the page may scroll under a still pointer. Writes into `out` when given.

```ts
function toBox(
  point: { readonly x: number; readonly y: number },
  box: ClientBox,
  out?: { x: number; y: number },
): { x: number; y: number }
```

| Parameter | Type | Description |
| --- | --- | --- |
| `point` | `{ readonly x: number; readonly y: number }` |  |
| `box` | `ClientBox` |  |
| `out?` | `{ x: number; y: number }` |  |

Also exported from `@dioramajs/effects/kit`.

Defined in [packages/effects/src/kit.ts](https://github.com/MasterKurosava/diorama/blob/main/packages/effects/src/kit.ts#L340).
