Constructor of canvas manager
the engine managing the whole library
the parent container
The canvasManager
Canvas rendering context settings
the canvas context settings
Clears the canvas directly
Clears the canvas content through the layer system.
First checks plugins registered in the dedicated #canvasClearPlugins array (plugins that
implement canvasClear as their only rendering hook, e.g. trail), then iterates all layers
in ordinal order (0–7) for any additional canvasClear implementations.
The first plugin that returns true short-circuits the clear. If no plugin handles it,
falls back to canvasClear which respects actualOptions.clear.
Destroying object actions
Generic draw method for drawing stuff on the canvas context
The cb
the result of the callback
Draws all particles for the current frame via the layer-based rendering pipeline.
Layer order (back to front):
0. BackgroundElement — auto-draw background.element via ctx.drawImage
background.draw(ctx, delta) callbackplugin.canvasPaint() for each pluginplugin.drawSettingsSetup(ctx, delta) for each pluginplugin.draw(ctx, delta) for each pluginparticles.drawParticles(delta) (core particle rendering)plugin.clearDraw() + plugin.drawSettingsCleanup() for each pluginThe delta time
Initializes the canvas element
Initializes the plugins needed by canvas.
Assigns each plugin to ALL layers where it has relevant hooks, not just one primary layer.
This enables plugins like BackgroundMaskPluginInstance that implement multiple hooks
(canvasPaint→BackgroundMask, drawSettingsSetup→CanvasSetup, drawSettingsCleanup→CanvasCleanup)
to participate in all the layers they need.
Hook-independent features (particleFillColor, particleStrokeColor, drawParticle,
drawParticleSetup, drawParticleCleanup) are collected into separate arrays for
per-particle use during rendering.
Initializes the updaters needed by canvas
Paints the canvas background
Paints the canvas background with an optional base color
OptionalbaseColor: stringThe baseColor
Paints an image on the canvas with the given opacity
The image
The opacity value
Sets the canvas rendering context
The rendering context
Sets the canvas rendering context settings
The settings
Stops the renderer and clears the canvas
Canvas manager