Repository navigation
Description
Is your feature request related to a problem? Please describe.
TextureAtlas chooses a parser with identifyFormat(atlas.meta.app), which only accepts a meta.app containing "texturepacker", "free-tex-packer", "shoebox", "aseprite" or "melonJS" (packages/melonjs/src/video/texture/atlas.js, lines 88–100 on master). Other tools that write the same TexturePacker or Aseprite JSON structure, but put their own name or URL in meta.app, are rejected before any parsing:
Error: Unknown texture atlas format: https://spritesheet.dev/
What I checked with melonJS 20.17.0 from npm in headless Chromium (Canvas and WebGL 2 renderers for the TexturePacker files, Canvas for the Aseprite one):
- A TexturePacker JSON (Array) file from spritesheet.dev is rejected with the error above. The same file with only
meta.appchanged tohttps://www.codeandweb.com/texturepackerloads, and every frame's name, rectangle and drawn pixels match the sheet. - An Aseprite JSON export from spritesheet.dev is rejected the same way. With only
meta.appchanged tohttps://www.aseprite.org/it loads as format "aseprite". - Separately,
parseTexturePackeriteratesdata.frames.forEach(...), so TexturePacker's "JSON (Hash)" variant (frames as an object keyed by name) fails withframes.forEach is not a functioneven whenmeta.appis recognised.
Minimal repro:
const json = {
frames: [{ filename: "a", frame: { x: 0, y: 0, w: 16, h: 16 }, rotated: false, trimmed: false,
spriteSourceSize: { x: 0, y: 0, w: 16, h: 16 }, sourceSize: { w: 16, h: 16 } }],
meta: { app: "https://example.com/my-packer", version: "1.0", image: "sheet.png",
format: "RGBA8888", size: { w: 16, h: 16 }, scale: "1" },
};
new me.TextureAtlas(json, image); // Error: Unknown texture atlas format: https://example.com/my-packerDescribe the solution you'd like
When meta.app isn't one of the known names, fall back to the structure of the file instead of throwing, for example:
meta.frameTagspresent (Aseprite always writes it) → Aseprite parser;- otherwise
frameswithframerectangles plusmeta.image→ TexturePacker parser.
It would also help if parseTexturePacker accepted the Hash variant (iterate Object.entries(frames) when frames isn't an array, using the key as the frame name).
That way any exporter that writes these formats works, without having to claim to be TexturePacker or Aseprite.
Describe alternatives you've considered
- Writing "texturepacker" or "aseprite" into our own
meta.app. It works today, but it misstates which app wrote the file, so we'd rather not. - Telling users to edit
meta.appby hand.
Additional context
Disclosure: I make spritesheet.dev, a free browser tool that writes TexturePacker JSON (Hash and Array) and Aseprite JSON. I ran into this while checking our exports against several engines.
Text drafted with help from an AI assistant.
Activity
TextureAtlas: tighten format detection, share the frame parsing
obiot commentedon Nov 25, 2026
Thanks for the detailed report. This is fixed in #1917:
meta.appis not a tool melonJS knows by name is now recognised from the structure of the file, so your exports load under your own name;It will ship in melonJS 20.18.0.
Here is a melonJS loading example you can reuse on spritesheet.dev, next to the Phaser and Pixi ones:
It works for the TexturePacker (Hash or Array) and Aseprite JSON exports alike. For a single frame, use
atlas.createSpriteFromName("walk_0").Generated by Claude Code
TextureAtlas: recognise TexturePacker / Aseprite JSON from other expo…