Text

data class Text(val text: String, val textStyle: TextStyle, val textMeasurer: TextMeasurer) : ParticleShape(source)

A text or emoji particle.

The string is rasterized once into an ImageBitmap (lazily, on first draw) using textMeasurer and textStyle, then drawn like an Image particle — so emitting many text particles stays cheap. Obtain the measurer with rememberTextMeasurer().

Constructors

Link copied to clipboard
constructor(text: String, textStyle: TextStyle, textMeasurer: TextMeasurer)

Properties

Link copied to clipboard

the string (or emoji) to render.

Link copied to clipboard

the TextMeasurer used to lay out and rasterize the text.

Link copied to clipboard

the TextStyle controlling font, size, and color of the rasterized text.