EmitterConfig

constructor(id: String = "", particlesCount: Int = 10, emitDurationMillis: Long = 0, particleLifespanMillis: Long = 2000, initialForce: Int = 100, gravityStrength: Float = 1.0f, gravityAngle: Int = 0, spread: IntRange = IntRange(-180, 180), maxHorizontalDisplacementDp: Int = 2000, rotationMultiplier: Float = 1.0f, randomStartPoint: Boolean = true, particle: @Composable () -> Unit)(source)

Parameters

id

identifier used to key the particle in composition; set by MultiEmitter to distinguish concurrent emitters. Leave as the default for a single emitter.

particlesCount

number of particles emitted in one run.

emitDurationMillis

how long emission takes, in milliseconds. 0 emits every particle at once; a positive value staggers emission evenly across the duration. This is the duration of the emitter, not of the whole animation — the entire animation lasts emitDurationMillis plus the particleLifespanMillis of the last emitted Particle.

particleLifespanMillis

how long each particle stays on screen, in milliseconds.

initialForce

launch-velocity multiplier for each particle (default 100); higher values fling particles farther from the start point.

gravityStrength

strength of gravitational force applied to particles in Dp/s². A value of 0 means no gravity. Higher values create stronger pull.

gravityAngle

direction of gravity in degrees. 0 degrees points downward (bottom of the screen), 90 degrees points left, -90 degrees points right, 180 degrees points upward.

spread

range of launch angles (degrees) sampled randomly per particle. 0° points toward the top of the screen (vertical).

maxHorizontalDisplacementDp

horizontal boundary, in Dp, that a particle may travel from its start point. 0 means no boundary.

rotationMultiplier

scales how much each particle spins over its lifespan: 0f disables rotation, 1f (default) is one full back-and-forth turn, higher values spin faster.

randomStartPoint

when true (default) each particle starts at a random point within the emitter bounds; when false all particles start from the center.

particle

the @Composable content drawn for every particle.