---
url: https://cri-middleware.github.io/SSPlayerForWeb/api/@spritestudio/ssplayer-pixi-ui/functions/canvasRectFrom.md
---
# Function: canvasRectFrom()

> **canvasRectFrom**(`width`, `height`, `pivotX`, `pivotY`): [`SSPlacementBox`](../interfaces/SSPlacementBox.md)

Defined in: packages/ssplayer-core/dist/index.d.ts:3069

The authored canvas as a box in player-local units, Y down.

`pivot` is normalised from the canvas centre in editor space (Y up), so a
character standing on its origin — pivot `(0, -0.5)` — gets a box wholly above
it.

## Parameters

### width

`number`

### height

`number`

### pivotX

`number`

### pivotY

`number`

## Returns

[`SSPlacementBox`](../interfaces/SSPlacementBox.md)
