Skip to content
pixi-silk
GitHub repository
Type

MeasureFunction

import type { MeasureFunction } from 'pixi-silk/layout';
type MeasureFunction = (availableWidth: number, availableHeight: number) => Size & {
  baseline?: number;
};

Measures leaf content (text, a sprite) for the space offered. Either argument is Infinity when that axis is unconstrained. Return the content size without padding. baseline is the distance from the top to the first text baseline, for alignItems: 'baseline'.

Parameters#

ParameterType
availableWidthnumber
availableHeightnumber

Returns#

Size & { baseline?: number; }