Skip to content
pixi-silk
GitHub repository
Function

wrapText

import { wrapText } from 'pixi-silk/ui/layout';
function wrapText(child: Container, availableWidth: number): Size;

A measure that wraps a text child to the width offered: Pixi Text (through its style) or SilkText. Long copy then breaks into lines instead of overflowing its slot. It turns on the child’s wordWrap and sets wordWrapWidth. Other children are measured by their bounds.

Parameters#

ParameterType
childContainer
availableWidthnumber

Returns#

Size