ReferenceSamplersType
SamplerFn
A function that produces a value.
type SamplerFn<T> = (ctx: SamplerContext) => T;A function that produces a value each time it’s called, such as a random size or color.
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”Returns
Section titled “Returns”T
Example
Section titled “Example”// Every particle's size will be a bit larger than the one before.const growing: SamplerFn<number> = (ctx) => 2 + ctx.index * 0.5;