Releases: PiotrPrus/ParticleEmitter
v1.1.0 — Compose Multiplatform
ParticleEmitter is now a Compose Multiplatform library. The same physics-based particle API runs on Android, JVM desktop, iOS, macOS, and the web (JS/Wasm) — no longer Android-only.
Huge thanks to @zsmb13 for the migration (#19) — the project's first external contribution. 🎉
Changes
- Kotlin / Compose Multiplatform. The library now targets Android, JVM (desktop), iOS (arm64 + simulator), macOS, JS, and Wasm. Dependencies moved from AndroidX Compose to JetBrains Compose (
org.jetbrains.compose.*). - Library code relocated to
commonMain. Platform-specific calls were replaced with multiplatform-safe equivalents (Dispatchers.Defaultinstead ofDispatchers.IO, frame-based particle timestamps instead ofSystem.nanoTime()). No public API changes to the emitter or config types. - Samples restructured into
samples/{androidApp, shared, desktopApp, webApp, iosApp}— runnable demos for every supported platform. - CI added to build the library and samples across all targets.
Requirements
- Build with JDK 21 and a recent Kotlin/Compose toolchain. On Android, Compose Multiplatform stays binary-compatible with AndroidX Compose.
Install
implementation("io.github.piotrprus:particle-emitter:1.1.0")v1.0.5 — Text & Ring emitters
Two new config knobs plus sample screens demonstrating them.
Changes
ParticleShape.Text(text, textStyle, textMeasurer)— new shape variant. The text is rasterized once into an ImageBitmap and drawn as a texture on every frame, so hundreds of text/emoji particles stay smooth.CanvasEmitterConfig.hideInStartRegion— whentrue, particles currently inside the start region are not drawn. Pairs withShape.OVAL+ 360° spread to keep the ring interior clean.- New
EmojiRainsample — emojis falling from the top with a live slider and a 3-second burst button. - New
RingEmittersample — ring emitter with a toggle for the new hide flag.
Install
implementation("io.github.piotrprus:particle-emitter:1.0.5")v1.0.4 — Performance
Performance-focused release — reduces allocation pressure and skips unnecessary draws. No API changes.
Changes
- Cache per-particle animation configs to cut allocation pressure
- Skip draw when particle is fully transparent or scaled to zero
- Drop unused
idfield fromCanvasParticle(internal) - New
BenchmarkandSingleEmitterBenchmarksample screens - New
MagicWandsample — drag emitter with world-space star trails - PERFORMANCE.md with measured particle budgets per target FPS
- Sample menu converted to LazyColumn
- README media optimized (~88% smaller gifs)
Install
implementation("io.github.piotrprus:particle-emitter:1.0.4")v1.0.3 — Edge Behaviors
Adds EdgeBehavior configuration to CanvasEmitter, letting particles bounce, stick, or wrap at canvas boundaries (in addition to the default "none" behavior).
Changes
- New
EdgeBehaviorAPI (None,Bounce,Stick,Wrap) CanvasEmitterConfiggains anedgeBehaviorparameterStickyEdgessample screen demonstrating each mode- README updated with edge behavior docs and demo GIF
Install
implementation("io.github.piotrprus:particle-emitter:1.0.3")v1.0.2
What's New
Configurable directional gravity for particles
Both ParticlesEmitter and CanvasParticleEmitter now support directional gravity via two new parameters:
gravityStrength— strength of gravitational force (Dp/s²).0= no gravity.gravityAngle— direction of gravity in degrees.0= down,180= up,-90= right,90= left.
This enables effects like falling confetti, rain, rising bubbles, wind, and diagonal forces.
CanvasParticleEmitter — physics-based motion
The canvas emitter now uses real physics (velocity + acceleration) instead of tween interpolation. Particles follow natural arcs when gravity is applied.
Sample app improvements
- New Gravity sample with on/off toggle
- New Gravity Point sample with draggable attractor and force slider
- Screens extracted to separate files under
screen/package - Fixed edge-to-edge status bar padding
Breaking Changes
EmitterConfig.gravityMultiplier→ replaced bygravityStrength: Float+gravityAngle: IntCanvasEmitterConfig.flyDistancesDp→ renamed toinitialForce: IntRangeCanvasEmitterConfig.translateEasing→ removed (physics replaces tween for position)
Migration from 1.0.1
// Before (1.0.1)
EmitterConfig(gravityMultiplier = 0.5f, ...)
// After (1.0.2)
EmitterConfig(gravityStrength = 0.5f, gravityAngle = 0, ...)// Before (1.0.1)
CanvasEmitterConfig(flyDistancesDp = IntRange(40, 100), translateEasing = FastOutSlowInEasing, ...)
// After (1.0.2)
CanvasEmitterConfig(initialForce = IntRange(40, 100), ...)Installation
implementation("io.github.piotrprus:particle-emitter:1.0.2")v1.0.1
What's new
- Smooth config updates — Changing emitter parameters (e.g. birth rate) no longer restarts the animation. Config is read reactively each frame via
rememberUpdatedState. - Frame-delta particle spawning — Replaced interval-based emission with frame-delta accumulation for accurate, smooth birth rates.
- Reactive remember keys —
rememberandLaunchedEffectinParticlesEmitterandMultiEmitternow properly react to config changes. - Sample app overhaul — Navigation between demos, interactive birth rate slider for the canvas emitter.
Installation
dependencies {
implementation "io.github.piotrprus:particle-emitter:1.0.1"
}Available on Maven Central.