Skip to content

Surface

A texture as the engine holds it: its pixels (kept for context loss and renderer swaps) and the renderer’s copy.

source: HTMLCanvasElement | HTMLImageElement | ImageBitmap

The pixels.


texture: Texture | null

The renderer’s texture of it, made on first draw (null until then, and after a renderer swap).


pending: [HTMLCanvasElement, number, number][]

Regions baked since the last upload: [scratch canvas, x, y].