API reference

Every public class, method, and event in @codexo/exojs. Generated from source.

C

classSpawnOnDeath

@codexo/exojs-particles / particles / stable

Sub-emitter: triggers a child SpawnModule on a target system at the dying particle's position. Use for explosion-on-impact, sparks at end of life, multi-stage VFX. The child module receives a synthesized `dt` of 0 - it must spawn immediately rather than rely on rate accumulation. BurstSpawn works naturally; RateSpawn is the wrong fit here. Position is the only field taken from the dying particle - child distributions decide everything else, and their sampled positions are treated as offsets from the death position. To keep child particles riding the parent's velocity, configure the child's velocity distribution to match, or read ParticleDeathContext.velocityX in a custom death module - see that type's docs for how it can be one frame stale on the GPU backend.

3
props
2
methods
0
events
Import
import { SpawnOnDeath } from '@codexo/exojs-particles'

Sub-emitter: triggers a child SpawnModule on a target system at the dying particle's position. Use for explosion-on-impact, sparks at end of life, multi-stage VFX.

The child module receives a synthesized `dt` of 0 - it must spawn immediately rather than rely on rate accumulation. BurstSpawn works naturally; RateSpawn is the wrong fit here.

Position is the only field taken from the dying particle - child distributions decide everything else, and their sampled positions are treated as offsets from the death position. To keep child particles riding the parent's velocity, configure the child's velocity distribution to match, or read ParticleDeathContext.velocityX in a custom death module - see that type's docs for how it can be one frame stale on the GPU backend.

Constructors1
Methods2
destroy(): void
Optional cleanup hook called from ParticleSystem.destroy.
Properties3
count: number
Number of times to invoke the spawner per dying particle. Default 1.
Source