constructor(atlases, src, cache) {
		/**
		 * to identify the atlas format (e.g. texture packer)
		 * @ignore
		 */
		this.format = null;

		/**
		 * the texture source(s) itself
		 * @type {Map}
		 * @ignore
		 */
		this.sources = new Map();

		/**
		 * the atlas dictionnaries
		 * @type {Map}
		 * @ignore
		 */
		this.atlases = new Map();

		/**
		 * the default "active" atlas (used for multiAtlas)
		 * @type {Map}
		 * @ignore
		 */
		this.activeAtlas = undefined;

		// parse given atlas(es) paremeters
		if (typeof atlases !== "undefined") {
			// normalize to array to keep the following code generic
			atlases = Array.isArray(atlases) ? atlases : [atlases];
			for (const i in atlases) {
				const atlas = atlases[i];

				if (typeof atlas.meta !== "undefined") {
					this.format = identifyFormat(atlas.meta.app);
					this.repeat = atlas.meta.repeat || "no-repeat";
					switch (this.format) {
						case "texturepacker":
						case "aseprite":
							// set the texture
							if (typeof src === "undefined") {
								// get the texture name from the atlas meta data
								const image = getImage(atlas.meta.image);
								if (!image) {
									throw new Error("Atlas texture '" + image + "' not found");
								}
								this.sources.set(atlas.meta.image, image);
							} else {
								this.sources.set(
									atlas.meta.image || "default",
									typeof src === "string" ? getImage(src) : src,
								);
							}
							// initialize the atlas
							if (this.format === "texturepacker") {
								this.atlases.set(
									atlas.meta.image || "default",
									parseTexturePacker(atlas, this),
								);
							} else {
								this.atlases.set(
									atlas.meta.image || "default",
									parseAseprite(atlas, this),
								);
							}
							break;
						case "shoebox":
							if (
								!atlas.meta.exporter ||
								!atlas.meta.exporter.includes("melonJS")
							) {
								throw new Error(
									"ShoeBox requires the JSON exporter : " +
										"https://github.com/melonjs/melonJS/tree/master/media/shoebox_JSON_export.sbx",
								);
							}
							this.sources.set(
								"default",
								typeof src === "string" ? getImage(src) : src,
							);
							// initialize the atlas
							this.atlases.set(
								atlas.meta.image || "default",
								parseTexturePacker(atlas, this),
							);
							break;
						case "melonJS":
							this.sources.set(
								"default",
								typeof src === "string" ? getImage(src) : src,
							);
							// initialize the atlas
							this.atlases.set(
								atlas.meta.image || "default",
								parseTexturePacker(atlas, this),
							);
							break;
						default:
							throw new Error(
								"Unknown texture atlas format: " + atlas.meta.app,
							);
					}
				} else {
					// a regular spritesheet
					if (
						typeof atlas.framewidth !== "undefined" &&
						typeof atlas.frameheight !== "undefined"
					) {
						this.format = "Spritesheet (fixed cell size)";
						this.repeat = "no-repeat";

						if (typeof src !== "undefined") {
							// overwrite if specified
							atlas.image = typeof src === "string" ? getImage(src) : src;
						}
						// initialize the atlas
						this.atlases.set("default", parseSpriteSheet(atlas, this));
						this.sources.set("default", atlas.image);
					}
				}
			} // end forEach
			this.activeAtlas = this.atlases.keys().next().value;
		}

		// if format not recognized
		if (this.atlases.length === 0) {
			throw new Error("texture atlas format not supported");
		}

		// Add self to TextureCache if cache !== false
		if (cache !== false) {
			this.sources.forEach((source) => {
				renderer.cache.set(source, this);
			});
		}
	}
@param {object|object[]} atlases - atlas information. See {@link loader.getJSON}
@param {HTMLImageElement|HTMLCanvasElement|OffscreenCanvas|string|OffscreenCanvas[]|HTMLImageElement[]|HTMLCanvasElement[]|string[]} [src=atlas.meta.image] - Image source
@param {boolean} [cache=false] - Use true to skip caching this Texture
@example
// create a texture atlas from a JSON Object
game.texture = new me.TextureAtlas(
    me.loader.getJSON("texture")
);

// create a texture atlas from a multipack JSON Object
game.texture = new me.TextureAtlas([
    me.loader.getJSON("texture-0"),
    me.loader.getJSON("texture-1"),
    me.loader.getJSON("texture-2")
]);

// create a texture atlas for a spritesheet with an anchorPoint in the center of each frame
game.texture = new me.TextureAtlas(
    {
        framewidth : 32,
        frameheight : 32,
        anchorPoint : new me.Vector2d(0.5, 0.5)
    },
    me.loader.getImage("spritesheet")