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

Method toImageBitmap

packages/melonjs/src/renderable/mesh.js:1026–1028  ·  view source on GitHub ↗

* Render the mesh at its current state to an ImageBitmap. * Useful for creating textures or sprites from the rendered mesh. * @returns {Promise } a promise that resolves to an ImageBitmap of the rendered mesh * @example * const bitmap = await mesh.toImageBitmap(); * const sprit

()

Source from the content-addressed store, hash-verified

1024 * const sprite = new me.Sprite(100, 100, { image: bitmap });
1025 */
1026 toImageBitmap() {
1027 return createImageBitmap(this.toCanvas());
1028 }
1029}

Callers

nothing calls this directly

Calls 1

toCanvasMethod · 0.95

Tested by

no test coverage detected