tsParticles - v0.0.0
    Preparing search index...

    Engine class for creating the singleton on globalThis. It's a singleton class for initializing Container instances, and for Plugins class responsible for every external feature

    Index

    Constructors

    Properties

    colorManagers: Map<string, IColorManager> = ...
    easingFunctions: Map<EasingTypeAlt | EasingType, EasingFunction> = ...
    effectDrawers: Map<Container, Map<string, IEffectDrawer<Particle>>> = ...

    The drawers (additional effects) array

    initializers: Initializers = ...
    movers: Map<Container, IParticleMover[]> = ...
    pathGenerators: Map<Container, Map<string, IMovePathGenerator>> = ...

    The path generators array

    plugins: IPlugin[] = []

    The plugins array

    presets: Map<string, RecursivePartial<IOptions>> = ...

    The presets array

    shapeDrawers: Map<Container, Map<string, IShapeDrawer<Particle>>> = ...

    The drawers (additional shapes) array

    updaters: Map<Container, IParticleUpdater[]> = ...

    The updaters array

    Accessors

    Methods

    • addEffect adds effect to tsParticles, it will be available to all future instances created

      Parameters

      • effect: string

        the effect name

      • drawer: EffectInitializer

        the effect drawer function or class instance that draws the effect in the canvas

      Returns void

    • Adds a particle updater to the collection

      Parameters

      • name: string

        the particle updater name used as a key

      • updaterInitializer: UpdaterInitializer

        the particle updater initializer

      Returns void

    • addPlugin adds plugin to tsParticles, if an instance needs it, it will be loaded

      Parameters

      Returns void

    • addPreset adds preset to tsParticles, it will be available to all future instances created

      Parameters

      • preset: string

        the preset name

      • options: Readonly<ISourceOptions>

        the options to add to the preset

      • override: boolean = false

        if true, the preset will override any existing with the same name

      Returns void

    • addShape adds shape to tsParticles, it will be available to all future instances created

      Parameters

      • shapes: string[]

        the shape names to add, it can be a single shape or an array of shapes

      • drawer: ShapeInitializer

        the shape drawer function or class instance that draws the shape in the canvas

      Returns void

    • Parameters

      • pluginVersion: string

        the plugin version to check against

      Returns void

    • Dispatches an event that will be listened from listeners

      Parameters

      • type: string

        The event to dispatch

      • Optionalargs: CustomEventArgs

        The event parameters

      Returns void

    • Searches if the specified plugin exists and returns it

      Parameters

      • plugin: string

        the plugin name

      Returns IPlugin | undefined

      the plugin if found, or undefined

    • Returns all the container particle updaters

      Parameters

      • container: Container

        the container used to check which particle updaters are enabled

      • force: boolean = false

        if true reloads the updater collection for the given container

      Returns Promise<IParticleUpdater[]>

      the array of updaters for the given container

    • init method, used by imports

      Returns Promise<void>

    • Retrieves a Container from all the objects loaded

      Parameters

      • index: number

        The object index

      Returns Container | undefined

      The Container object at specified index, if present or not destroyed, otherwise undefined

    • Reloads all existing tsParticles loaded instances

      Parameters

      • refresh: boolean = true

        should refresh the dom after reloading

      Returns Promise<void>

    • Parameters

      • ...loaders: LoadPluginFunction[]

      Returns Promise<void>