Skip to content
pixi-silk
GitHub repository
Class

IslandStack

import { IslandStack } from 'pixi-silk/ui/island';

A row or a column of items, centred across the axis. Sizes come from each item’s local bounds, so items can draw around any origin. Call IslandStack.layout again after an item changes size. An island stacks its items in one of these.

Extends#

  • Container

Constructors#

Constructor#

new IslandStack(items?: Container<ContainerChild>[], options?: IslandStackOptions): IslandStack;

Parameters#

ParameterTypeDefault value
itemsContainer<ContainerChild>[][]
optionsIslandStackOptions{}

Returns#

IslandStack

Overrides#

Container.constructor

Properties#

PropertyModifierTypeDescriptionDefined in
axisreadonly"x" | "y"Stacking axis.packages/pixi-silk/src/ui/island/stack.ts:18
gappublicnumberSpace between items, local units.packages/pixi-silk/src/ui/island/stack.ts:20

Accessors#

across#

Get Signature#

get across(): number;

Size of the widest item across the axis, local units.

Returns

number


along#

Get Signature#

get along(): number;

Length of the stack along its axis, local units.

Returns

number

Methods#

layout()#

layout(width?: number, height?: number): this;

Places the items. With a box (width by height) the stack is centred in it, otherwise it starts at (0, 0).

Parameters#

ParameterType
width?number
height?number

Returns#

this