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#
| Parameter | Type |
|---|---|
silk | Silk |
data | ThemeData |
Returns#
SilkTheme
Properties#
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
rows | readonly | PixiStyleRows | Where the rows go on the GPU: the writeStyleRows part of the Pixi backend. | packages/pixi-silk/src/i18n/pixi/silk.ts:185 |
table | readonly | StyleTable | The 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#
| Parameter | Type |
|---|---|
name | string |
Returns#
set()#
set(name: string, patch: ThemeStyle): void;
Changes a style (base for untagged text). See the class notes for what can change.
Parameters#
| Parameter | Type |
|---|---|
name | string |
patch | ThemeStyle |
Returns#
void