CameraOptions
import type { CameraOptions } from 'pixi-silk/ui/camera';
Options of Camera.
Properties#
| Property | Type | Description | Defined in |
|---|---|---|---|
element | HTMLElement | The element that receives input, usually app.canvas. | ui/camera.ts:37 |
ignore? | (point: PointData) => boolean | Element points (CSS pixels) the camera leaves alone: wheels and pan drags there go to the scene instead. Use it for panels drawn over the view, with panelHitTest from pixi-silk/ui/panel. | ui/camera.ts:71 |
inertia? | boolean | Keep panning after a fling, slowing down. Default true. | ui/camera.ts:52 |
keys? | boolean | Keyboard shortcuts on window: + and - zoom, Shift + 0 is 100%, Shift + 1 fits Camera.content. Default true. | ui/camera.ts:57 |
pageScroll? | boolean | "auto" | Who gets a plain scroll while the canvas sits in a page that scrolls. With auto (default) or true the page keeps scrolling until the canvas is clicked, then the camera pans until the pointer leaves. Pinch and ctrl / cmd + wheel always zoom. auto only applies when the page can scroll, so a full-screen canvas pans at once. false always pans. | ui/camera.ts:64 |
panButtons? | number[] | Mouse buttons that pan when dragged: 1 middle, 2 right. Default [1, 2]. | ui/camera.ts:46 |
smoothing? | number | How fast animated zooms settle, about 1 / seconds. Default 16. | ui/camera.ts:66 |
spacePan? | boolean | Holding Space turns a left drag into a pan. Default true. | ui/camera.ts:48 |
ticker? | Ticker | null | Ticker that runs animations and flings. Default Ticker.shared. With null nothing animates until you call Camera.tick. | ui/camera.ts:76 |
touchPan? | "one" | "two" | How touch pans: with two fingers (default, one finger stays with the scene) or one. | ui/camera.ts:50 |
wheel? | "pan" | "zoom" | What a plain wheel does. pan (default, like Figma): scroll pans, pinch or ctrl / cmd + wheel zooms. zoom (like a map): the wheel zooms, Shift + wheel pans. | ui/camera.ts:44 |
world | Container | The container the camera moves and scales. Put overlays (outlines, measures) beside it, not inside. | ui/camera.ts:35 |
zoomRange? | [number, number] | Smallest and largest zoom, where 1 is 100%. Default [0.02, 256]. | ui/camera.ts:39 |