Skip to content

anim-format (runtime format) / ParticleConfig

Interface: ParticleConfig ​

Properties ​

PropertyTypeDescription
emitobject-
emit.bursts?object[]one-off puffs: count particles at t seconds
emit.duration?numberthe stream stops after this many seconds (emitter time incl. prewarm); none = never
emit.maxnumberat most this many alive at once (the oldest go first)
emit.prewarm?numberthe first frame looks as if the stream had run this many seconds
emit.ratenumberparticles per second (the steady stream)
life[number, number]seconds, [min, max]
lookobject-
look.alignToMotion?booleanturn each particle to its direction of travel
look.alphaParticleNumberStop[]alpha over life, 0..1
look.colorParticleColorStop[]colour over life; one stop = flat
look.colorJitter?number± brightness jitter per particle, 0..1
look.hueJitter?number± hue turn per particle, degrees (180 = any colour)
look.rotation?[number, number]start rotation range (degrees) and spin speed range (degrees / s)
look.sizeobjectdiameter in px at birth / death; jitter = ± fraction per particle
look.size.endnumber-
look.size.jitter?number-
look.size.startnumber-
look.size.stops?ParticleNumberStop[]-
look.spin?[number, number]-
look.stretch?numberstretch along the motion by speed × this (seconds), for rain / sparks
look.texture| ParticleBuiltinTexture | { asset: string; frameMode?: "life" | "random"; frames?: number; }a built-in texture, or {asset} / {sheet} resolved by the renderer
motionobject-
motion.alongNormal?booleanshoot along the shape's outward normal instead of angle (spread still applies)
motion.anglenumberemission direction, degrees
motion.drag?numberlinear drag, 1 / s (velocity × e^(−drag·age)); with gravity it reaches gravity / drag
motion.gravity?objectconstant acceleration, px / s² (gravity, wind …)
motion.gravity.xnumber-
motion.gravity.ynumber-
motion.speed[number, number]start speed, px / s, [min, max]
motion.spreadnumberfull width of the spread fan, degrees (360 = all round)
motion.turbulence?objectsmooth wandering: amount px, scale px per noise cell, speed cells / s
motion.turbulence.amountnumber-
motion.turbulence.scalenumber-
motion.turbulence.speednumber-
motion.vortex?numberturning about the emitter's centre, degrees / s
seednumber32-bit integer; same seed = same result
shapeobject-
shape.fromEdge?booleanrect / ellipse: born on the outline instead of inside
shape.h?number-
shape.inner?numberring: inner size as a fraction of the outer (0..1)
shape.kindParticleShapeKind-
shape.points?number[]path: polyline points x0,y0,x1,y1,… in emitter space
shape.w?numberwidth / height of a line, rect, ellipse or ring (centred on the origin)
space"world" | "local"world: once born a particle stays where it was born (a moving emitter leaves a trail); local: the whole cloud moves with the emitter

HereSplash — 2D animation for the web