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<string, IEffectDrawer<Particle>>

    The drawers (additional effects) array

    movers: Map<Container, IParticleMover[]>
    pathGenerators: Map<string, IMovePathGenerator>

    The path generators array

    plugins: IPlugin[]

    The plugins array

    presets: Map<string, RecursivePartial<IOptions>>

    The presets array

    shapeDrawers: 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: IEffectDrawer

        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

    • addPathGenerator adds a named path generator to tsParticles, this can be called by options

      Parameters

      • name: string

        the path generator name

      • generator: IMovePathGenerator

        the path generator object

      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

      • drawer: IShapeDrawer

        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 the path generator with the given type name

      Parameters

      • type: string

        the path generator type to search

      Returns IMovePathGenerator | undefined

      the path generator if found, or undefined

    • Searches if the specified plugin exists and returns it

      Parameters

      • plugin: string

        the plugin name

      Returns IPlugin | undefined

      the plugin if found, or undefined

    • This method returns all the supported effects with this Plugins instance

      Returns IterableIterator<string>

      all the supported effects type name

    • This method returns all the supported shapes with this Plugins instance

      Returns IterableIterator<string>

      all the supported shapes type name

    • 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>