Camera: pan and zoom a world container, ZoomControl.
import { Camera, ZoomControl, zoomLabel } from 'pixi-silk/ui/camera';
Classes#
| Class | Description |
|---|
| Camera | Pans and zooms a world container over an unbounded canvas. It writes the world’s position and scale, so do not set them yourself while a camera owns the world. |
| ZoomControl | A - 100% + pill for a Camera, 128x32 pixels. The buttons zoom around the view’s centre and the percentage fits the content (or resets). The readout follows the camera’s zoom signal. Place it in screen space, beside the world. Destroying it unsubscribes from the camera. |
Interfaces#
Functions#
| Function | Description |
|---|
| zoomLabel | Formats a zoom (1 is 100%) as a short percentage. Below 10% it keeps one decimal (2.5%), from 10,000% it switches to k (2.5k%) and from 1,000,000% to M (1.2M%). |