Skip to content
party.js logoparty.js logo

ReferenceSamplersType

Sampler

A fixed value, or a function that produces one.

type Sampler<T> = T | SamplerFn<T>;

Either a fixed value, or a SamplerFn that produces one.

Wherever party.js accepts a sampler, you can pass a plain value that is shared between particles (for example size: 8), or a function that is called again for each particle (for example size: range(4, 12)). Typically, these functions will be evaluated when the particle spawns.

T