Skip to content
pixi-silk
GitHub repository
Function

placeBox

import { placeBox } from 'pixi-silk/ui/layout';
function placeBox(
   data: LayoutData, 
   window: ViewportRect, 
   out?: Placement
): Placement;

Where a record puts its box in a window: the fit scale of the window to the reference resolution, then stretch per axis, then the corrections, then the alignment. Pure, so you can check a layout record without a renderer. Writes into out when given, else returns a new object.

Parameters#

ParameterType
dataLayoutData
windowViewportRect
out?Placement

Returns#

Placement