Canvas Emitter Config
Configuration for CanvasParticleEmitter — describes how many particles to emit, where and in what shape they originate, how they look, and the physics that governs their motion.
Ranges (such as lifespanRange, fadeOutTime, or spread) and list properties (such as colors, particleShapes, or particleSizes) are sampled randomly per particle, so a single config can produce a varied, natural-looking effect. All defaults are tuned for a gentle upward burst with no gravity; override gravityStrength/gravityAngle for confetti, rain, or bubbles, and edgeBehavior to make particles bounce, stick, or wrap at the emitter bounds.
Parameters
is number of particles emitted by this source in 1sec. The emission happens every 100ms = 0,1s, so value less then 10 will be neglected.
is DpOffset for the center of Emitter
is the shape(path) for emitter. For example Point means every particle will be created at the same place emitterCenter
is DpSize of region where emission happens. The source for each particle will be picked randomly from circumference of the startRegionShape
list of shapes for particles. The emitter will pick randomly from the list of available shapes
duration of one particle. It is an IntRange to randomize the particle life
duration of fadeOut animation. Each particle can have random fadeOut time, so it is IntRange
duration of scaling animation. Use startScaleRange and targetScaleRange to control the parameters of particle scale
a list of colors that each particle will randomly pick from
a list of sizes in DpSize for each particle. It will be picked randomly from available sizes. The size can be also manipulated using startScaleRange and targetScaleRange
range of angles (in degrees) that describe the direction of path for each particle. 0 degrees points upward (top of the screen)
applied BlendMode on each particle
an easing curve that is applied for alpha animation on each particle
an easing curve that is applied for scale animation on each particle
initial velocity magnitude for each particle. Higher values make particles move faster from the emission point. The value is picked randomly from the provided range.
range of angles (in degrees) that each particle will rotate during translation
end scale for each particle
start scale for each particle
strength of gravitational force applied to particles in Dp/s². A value of 0 means no gravity. Higher values create stronger pull.
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.
defines how particles behave when they reach the composable boundary. See EdgeBehavior for options: EdgeBehavior.None (default), EdgeBehavior.Bounce, EdgeBehavior.Stick, EdgeBehavior.Wrap.
when
true, particles whose current position falls inside the start region (as defined by startRegionShape and startRegionSize) are not drawn. Useful for ring emitters with 360° spread where particles crossing the interior would otherwise clutter the center. Default isfalse.
Constructors
Types
Properties
A fresh emission point for the next particle, sampled from the perimeter of the start region. For Shape.POINT this is always emitterCenter; for the other shapes it is a random point along the region's circumference, so reading this property repeatedly yields a spread of origins across the shape.
Functions
Returns true if pos currently falls inside the start region described by startRegionShape and startRegionSize, centered on emitterCenter. Used by the emitter to honor hideInStartRegion. Shape.POINT, Shape.H_LINE, and Shape.V_LINE have no interior, so this always returns false for them.