The 2D layer · interface
Theme
Named colours and sizes, so an interface stops repeating its own constants.
Explained in Sprites and tilemaps.
interface Themeimport type { Theme } from '@driftengine/ui2d';In depth
Flattened at derivation rather than chained at lookup. A token is read per node per frame, so a chain of parent themes would be a walk on every one of those reads. Spreading once when a theme is derived costs a record and makes every lookup a single property access.
Properties
| Name | Type | Description |
|---|---|---|
valuesreadonly | Readonly<Record<string, number>> |