Skip to content
pixi-silk
GitHub repository
Function

packStyle

import { packStyle } from 'pixi-silk/i18n';
function packStyle(
   style: ThemeStyle, 
   out: Float32Array, 
   offset?: number
): void;

Packs a resolved style into one style row of STYLE_FLOATS floats at offset:

texelxyzw
0fill rgba
1outline rgba
2glow rgba
3shadow rgba
4outline width (px)glow width (px)shadow softness (0 to 1)weight bias (em)
5shadow offset x (px)y (px)underline thickness (em)underline offset (em)
6line rgba
7strike thickness (em)strike offset (em)flags0

Colours are straight (not premultiplied), with the style’s alpha multiplied in.

Parameters#

ParameterTypeDefault value
styleThemeStyleundefined
outFloat32Arrayundefined
offsetnumber0

Returns#

void