Skip to content
pixi-silk
GitHub repository
Function

minimapFit

import { minimapFit } from 'pixi-silk/ui/minimap';
function minimapFit(
   world: WorldRect, 
   width: number, 
   height: number, 
   padding?: number
): MinimapTransform;

Fits a world rectangle into a minimap of width by height, centred, with padding around it.

Parameters#

ParameterTypeDefault value
worldWorldRectundefined
widthnumberundefined
heightnumberundefined
paddingnumber8

Returns#

MinimapTransform