Skip to content
pixi-silk
GitHub repository
Entry point

pixi-silk/ui/minimap

Minimap: an overview of the world with the camera frame.

import { Minimap, minimapFit, minimapToWorld, unionRect } from 'pixi-silk/ui/minimap';

Classes#

ClassDescription
MinimapA minimap of a Camera’s world: the content in small, and the view as a frame. Drag the frame to pan, click anywhere to jump there, and scroll to zoom. The map follows the camera on every frame it moves, and glides when the content or the view grows past it.

Interfaces#

InterfaceDescription
MinimapOptionsOptions of Minimap.
MinimapStateThe reactive state of a Minimap.
MinimapTransformHow world units map onto the minimap: map = world * scale + (x, y).

Functions#

FunctionDescription
minimapFitFits a world rectangle into a minimap of width by height, centred, with padding around it.
minimapToWorldA minimap point in world units.
unionRectThe smallest rectangle around both.
worldRectToMinimapA world rectangle on the minimap.
worldToMinimapA world point on the minimap.