Skip to content
party.js logoparty.js logo

ReferenceSamplersInterface

SamplerContext

Information passed to a sampler function.

Information passed to a SamplerFn each time it is called.

batchoptionalobject

When sampling particle properties, multiple particles spawned in one simulation step are batched, in which case this field contains information on the batch. Otherwise this field will be absent.

batch.indexnumber

The particle’s position in the batch, starting at 0.

batch.sizenumber

How many particles will be spawned at once.

indexnumber

A running count. For a particle’s properties, it’s the number of particles the effect has spawned before this one. For a burst’s count, it’s the current loop of the EmissionSchedule.

rngRng

The effect’s random number generator. Use it instead of Math.random() to keep seeded effects reproducible.