ParticleShape

sealed interface ParticleShape(source)

How a particle is drawn by CanvasParticleEmitter.

A CanvasEmitterConfig takes a list of shapes and picks one at random per particle, so a single emitter can mix circles, images, glyphs, and custom paths.

Inheritors

Types

Link copied to clipboard

A filled circle whose radius comes from the particle's size and whose color is the particle tint.

Link copied to clipboard
data class Image(val imageBitmap: ImageBitmap) : ParticleShape

A bitmap particle. The bitmap is tinted with the particle's color via ColorFilter.tint.

Link copied to clipboard
data class PathShape(val shapePath: Path) : ParticleShape

A custom vector shape.

Link copied to clipboard
data class Text(val text: String, val textStyle: TextStyle, val textMeasurer: TextMeasurer) : ParticleShape

A text or emoji particle.