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

Function resolveEmbeddedImage

packages/melonjs/src/level/tiled/TMXUtils.js:32–44  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

30 * @param {object} data - tileset, tile, or layer data
31 */
32export function resolveEmbeddedImage(data) {
33 if (data.imagedata) {
34 const format = data.imageformat || "png";
35 data.image = cacheEmbeddedImage(
36 data.imagedata,
37 format,
38 data.imagewidth ? +data.imagewidth : undefined,
39 data.imageheight ? +data.imageheight : undefined,
40 );
41 delete data.imagedata;
42 delete data.imageformat;
43 }
44}
45
46/**
47 * Convert a Tiled blend mode name to a canonical melonJS blend mode.

Callers 4

constructorMethod · 0.90
_parseTilesMethod · 0.90
readImageLayerFunction · 0.90
tmxutils.spec.jsFile · 0.90

Calls 1

cacheEmbeddedImageFunction · 0.85

Tested by

no test coverage detected