Skip to content
party.js logoparty.js logo

ReferenceEffectsInterface

BaseEffectOptions

Shared options for effects.

Shared options for built-in and custom effects.

canvasoptionalHTMLCanvasElement

A canvas to draw onto. If none is provided, party.js draws onto a fullscreen canvas it shares between all effects, and removes it once no effect is using it anymore. If provided, positions are measured from the canvas’ top-left corner: the built-in effects measure their target relative to it, and a custom effect’s origin is given in its coordinates (see measureTarget()).

reducedMotionoptionalReducedMotion

What the effect does when the user has asked their system for reduced motion. A skipped effect draws nothing, and the finished promise on the effect handle resolves as “completed” after createEffect() returns, unless you stop the effect immediately. See ReducedMotion for more information. Without this option, the default set with setDefaultReducedMotion() is used, which is "skip" unless you changed it.

seedoptionalnumber

A seed for the effect’s random number generator. The same seed with the same options produces the same visuals each time. Without one, a random seed is generated and every run of the effect looks different.