Options
All
  • Public
  • Public/Protected
  • All
Menu

Options to be applied to particles during their creation.

Hierarchy

  • ParticleOptions

Index

Properties

Optional color

color: undefined | ((options: PixelOptions) => string)

Given a pixel in the img, calculates the color of the corresponding particle. Fewer colors will result in better performance (higher framerates). This function is only executed on pixels whose filters return true.

Optional filter

filter: undefined | ((options: PixelOptions) => boolean)

Given a pixel in the img, the filter determines whether or not a particle should be created for this pixel. This is run for all pixels in the image in random order until maxParticles limit is reached. If the filter returns true, a particle will be created for this pixel.

Optional friction

friction: undefined | ((options: PixelOptions) => number)

Given a pixel in the img, calculates the coefficient of kinetic friction of the corresponding particle. This should have a value between 0 and 1. This function is only executed on pixels whose filters return true.

Optional initialPosition

initialPosition: undefined | ((options: PixelOptions & { canvasDimensions: Dimensions; finalPosition: Vector }) => Vector)

Given a pixel in the img, calculates the initial position vector of the corresponding particle. This function is only executed on pixels whose filters return true.

Optional initialVelocity

initialVelocity: undefined | ((options: PixelOptions) => Vector)

Given a pixel in the img, calculates the initial velocity vector of the corresponding particle. This function is only executed on pixels whose filters return true.

Optional mass

mass: undefined | ((options: PixelOptions) => number)

Given a pixel in the img, calculates the mass of the corresponding particle. This function is only executed on pixels whose filters return true.

Optional radius

radius: undefined | ((options: PixelOptions) => number)

Given a pixel in the img, calculates the radius of the corresponding particle. This function is only executed on pixels whose filters return true.

Generated using TypeDoc