Skip to content
pixi-silk
GitHub repository
Type

IconSource

import type { IconSource } from 'pixi-silk/ui';
type IconSource = 
  | string
  | Texture
  | Container
  | ((g: SilkGraphics, size: number) => void);

Anything that can sit in a widget slot:

  • a string: drawn as text (a word, a glyph, an emoji),
  • a texture: drawn as a sprite fitted to the slot,
  • a container: used as is,
  • a function: draws a vector icon with pixi-silk, centred on (0, 0), size wide, in white.

Icons are drawn white and coloured with tint, so widgets recolour them without redrawing.