Overview
The SDK provides two approaches to particles:<ParticleEmitter>— high-level emitter backed by@barvynkoa/particle-emitter. Driven by a JSON config and a spritesheet asset key.<ParticleContainer>+<Particles>— lower-level approach using PixiJS’s nativePIXI.ParticleContainer. You control initialisation and per-frame update logic directly.
<ParticleEmitter>
A declarative particle emitter. Reads its texture fromstateApp.loadedAssets using key, upgrades the config to the latest format, and drives the emitter on the PixiJS ticker.
The emitter is destroyed automatically when the component is unmounted.
Props
Asset manifest key for the particle spritesheet (
type: 'spriteSheet'). The loaded texture array is passed to the emitter config automatically.The particle emitter configuration object. All three config versions from
@barvynkoa/particle-emitter are accepted — the SDK upgrades older formats automatically via upgradeConfig.When
true, reinitialises the emitter with the current config. Toggle this to trigger a burst or restart emission. Synced from Emitter.emit.A multiplier applied to
ticker.deltaMS before calling emitter.update(). Controls the effective simulation speed. Default 0.00234.Probability (0–1) that a particle will spawn on any given update. Inherited from
Emitter. Default 1.Maximum number of live particles at any time. Inherited from
Emitter.Custom particle class constructor. Inherited from
Emitter.Emitter config
Theconfig prop accepts the EmitterConfigV3 format from @barvynkoa/particle-emitter. Key fields:
Example
<ParticleContainer>
A wrapper aroundPIXI.ParticleContainer that provides the particle parent context to child <Particles> components. More performant than a regular <Container> for large numbers of identical sprites.
Props
One or more
<Particles> components.An object specifying which properties (
vertices, position, rotation, uvs, tint) are updated per particle. Enabling more properties increases GPU upload cost. From PIXI.ParticleContainerOptions.Maximum number of particles. Must be set at creation time. From
PIXI.ParticleContainerOptions.Number of particles per draw call batch. From
PIXI.ParticleContainerOptions.Whether the container automatically resizes to accommodate more particles than
maxSize. From PIXI.ParticleContainerOptions.Horizontal position. Default
0.Vertical position. Default
0.Opacity. Default
1.Whether the container is rendered. Default
true.Sort order within the parent. Default
0.CSS cursor string.
<Particles>
A low-level particle layer. Createssize PIXI.Particle instances using a texture resolved from stateApp.loadedAssets, calls init once on mount, and calls update on every PixiJS ticker tick.
Must be a child of <ParticleContainer>.
Props
Asset manifest key for a
sprite asset. The loaded texture is applied to every particle instance.The number of
PIXI.Particle instances to create.Called once after the particles are created. Set initial positions, scales, alphas, velocities, etc.
Called every frame via the PixiJS ticker. Mutate each particle’s properties to simulate motion, fade, etc. The
ParticleContainer is updated automatically after this callback.Example
<Particles> adds particles to the ParticleContainer at mount time and never removes them. To hide unused particles, set alpha = 0 in your update function rather than removing them.