ReferenceCustom effectsFunction
emitFrom()
Spawns particles from an area.
function emitFrom(shape: Live<EmissionShape>): SamplerFn<Vec3>;Creates a sampler for particle positions spread across an area.
The shape is Live: pass a function to make the follow something that changes, for example the window width. It’s read again for every particle that spawns.
Parameters
Section titled “Parameters”shapeLive<EmissionShape>The area to spawn particles from.
Returns
Section titled “Returns”SamplerFn<Vec3>A sampler for ParticleInit.position.
Example
Section titled “Example”// Along a line across the full width of the window.const positionSampler = emitFrom(() => ({ type: "rect", width: window.innerWidth, height: 0,}));