Skip to content
pixi-silk
GitHub repository
Interface

LayoutData

import type { LayoutData } from 'pixi-silk/ui/layout';

Where a SmartContainer sits on screen and how it scales, for one breakpoint. The box is in design units, and the reference resolution sets how design units map to the window.

Properties#

PropertyTypeDescriptionDefined in
align?"center" | "left" | "right"Horizontal anchor of the design box in the window. Default center.ui/layout/smart-container.ts:11
correctionOffsetX?numberMoves the box, in design units (multiplied by the scale). Default 0.ui/layout/smart-container.ts:35
correctionOffsetY?numberMoves the box, in design units (multiplied by the scale). Default 0.ui/layout/smart-container.ts:37
correctionScaleX?numberMultiplies the x scale. Default 1.ui/layout/smart-container.ts:31
correctionScaleY?numberMultiplies the y scale. Default 1.ui/layout/smart-container.ts:33
extendHeight?booleanKeep the uniform scale and make the box as tall as the window. Default false.ui/layout/smart-container.ts:29
extendWidth?booleanKeep the uniform scale and widen the box to the window instead. Flex children spread out. Default false.ui/layout/smart-container.ts:27
fitCover?booleanScale to cover the window (the larger ratio) instead of fitting inside it. Default false.ui/layout/smart-container.ts:39
height?numberHeight of the design box, in design units. Default 0.ui/layout/smart-container.ts:17
ignoreSafeArea?booleanPlace the box in the whole window, under notches and home bars. Default false.ui/layout/smart-container.ts:41
layout?SmartLayoutFlex style for the children inside the design box. Default the container’s layout.ui/layout/smart-container.ts:43
stretchHeight?booleanScale the y axis so the box spans the window height. Distorts the content. Needs a nonzero height. Default false.ui/layout/smart-container.ts:25
stretchWidth?booleanScale the x axis so the box spans the window width. Distorts the content. Needs a nonzero width. Default false.ui/layout/smart-container.ts:23
valign?"center" | "top" | "bottom"Vertical anchor of the design box in the window. Default center.ui/layout/smart-container.ts:13
viewportHeight?numberReference resolution height. Default 1920 in portrait, 1080 in landscape.ui/layout/smart-container.ts:21
viewportWidth?numberReference resolution width. Default 1080 in portrait, 1920 in landscape.ui/layout/smart-container.ts:19
width?numberWidth of the design box, in design units. Default 0.ui/layout/smart-container.ts:15