MCPcopy Create free account
hub / github.com/melonjs/melonJS / createCanvas

Method createCanvas

packages/melonjs/src/video/renderer.js:298–300  ·  view source on GitHub ↗

* Create and return a new Canvas element (or `OffscreenCanvas` when * supported and `returnOffscreenCanvas` is true). Centralized * renderer-side allocator so every scratch / fallback / render- * target canvas in the engine routes through the same * `OffscreenCanvas`-aware path, instead of d

(width, height, returnOffscreenCanvas = false)

Source from the content-addressed store, hash-verified

296 * @returns {HTMLCanvasElement|OffscreenCanvas} a new canvas of the given size
297 */
298 static createCanvas(width, height, returnOffscreenCanvas = false) {
299 return createCanvas(width, height, returnOffscreenCanvas);
300 }
301
302 /**
303 * Shared 1×1 fully-white canvas used as a no-op texture fallback.

Callers 15

createCanvasFunction · 0.80
getWhitePixelMethod · 0.80
drawMeshMethod · 0.80
lights.spec.jsFile · 0.80
mesh.spec.jsFile · 0.80
entity.spec.jsFile · 0.80
sprite.spec.jsFile · 0.80
makeSpriteFunction · 0.80
gltf_model.spec.jsFile · 0.80

Calls 1

createCanvasFunction · 0.90

Tested by 1

makeSpriteFunction · 0.64