Constructs a new Canvas2DHeadless
.
The offscreen canvas we're drawing to.
The rendering context to use for the canvas.
The configuration for this canvas.
Our back buffer.
Readonly
canvasThe canvas element we're interacting with.
Readonly
optionsThe configuration that was used for this canvas.
Retrieves the rendering context of the canvas.
The rendering context of the canvas.
Retrieves the height of the canvas.
The height of the canvas.
Retrieves the width of the canvas.
The width of the canvas.
Draws a slightly transparent, black rectangle over the canvas, and then reads the result back into the buffer.
The color to fade the buffer with. The alpha component of
the color defines how strong the fade is. 0
is not at all, 255
makes
it instantly black.
Recreate internal buffers in reaction to a change in our target OffscreenCanvas
.
Draw FPS information onto the canvas.
Durations of previous frame draws.
The duration of the previous frame draw.
The time elapsed since the last frame.
An offscreen canvas.
This isn't created from a DOM node, but from an existing
OffscreenCanvas
.