Skip to content
pixi-silk
GitHub repository
Class

SilkTheme

import { SilkTheme } from 'pixi-silk/i18n/pixi';

A theme bound to its style-row texture. set changes a style at runtime: paint properties (colours, outline, glow, shadow, lines, weight bias) rewrite a few style rows and move no glyph. Shape-relevant properties (weight, size, family, letter spacing, features) cannot change baked text: a dev warning says to run silk compile again.

Constructors#

Constructor#

new SilkTheme(silk: Silk, data: ThemeData): SilkTheme;

Parameters#

ParameterType
silkSilk
dataThemeData

Returns#

SilkTheme

Properties#

PropertyModifierTypeDescriptionDefined in
rowsreadonlyPixiStyleRowsWhere the rows go on the GPU: the writeStyleRows part of the Pixi backend.packages/pixi-silk/src/i18n/pixi/silk.ts:185
tablereadonlyStyleTableThe style rows.packages/pixi-silk/src/i18n/pixi/silk.ts:183

Accessors#

source#

Get Signature#

get source(): BufferImageSource;

The style rows as an RGBA32F texture (8 texels per row, 64 rows per texture row).

Returns

BufferImageSource

Methods#

get()#

get(name: string): ThemeStyle;

The resolved style of a tag (or base).

Parameters#

ParameterType
namestring

Returns#

ThemeStyle


set()#

set(name: string, patch: ThemeStyle): void;

Changes a style (base for untagged text). See the class notes for what can change.

Parameters#

ParameterType
namestring
patchThemeStyle

Returns#

void