Manual Reference

On this page
  1. Choosing formats
  2. All export formats
  3. Formats in detail
  4. atlas
  5. godot
  6. gif
  7. godot_scene
  8. normal
  9. emission
  10. pixi
  11. phaser
  12. love2d
  13. css
  14. indexed
  15. unity
  16. Other generators
  17. Versioned manifests
  18. Animation timing
  19. Quality report
  20. See also

Engine Formats

Every export format, the files it writes, their keys and how stable each one is.

mode8 export packs your frames into one atlas and then writes it out for the engines you name with --formats. This page lists every format, the exact files it writes for --name hero, the keys in its JSON files and its stability. The how-to lives in Exporting to Game Engines.

Note

This page is generated from mode8 schema --section formats and a real export in every format by docs/manual/_tools/gen_reference.py. To change it, change Mode 8 (or the prose in the generator) and run the generator with --write; a test fails when this page is out of date.

Choosing formats#

Pass a comma-separated list. The default is atlas,godot,gif:

bash
mode8 export frames/ --out-dir out --name hero --formats atlas,godot,pixi,phaser

Formats that need the atlas (most of them) write it too, so you never have to ask for atlas explicitly. <name> below is --name (default sprite).

All export formats#

FormatGroupStabilityFiles
atlascorestable<name>_atlas.png, <name>_atlas.json
godotgodotstable<name>.tres (+ <name>_atlas.png)
gifcorestable<name>.gif (the idle or first loop), <name>_<anim>.gif per animation
godot_scenegodotstable<name>.tscn (+ <name>.tres, <name>_atlas.png; a character scene also mode8_actor.gd)
normalgodotstable<name>_atlas_n.png, <name>_lit.tres, <name>_lit_frames.tres (+ <name>_atlas.png)
emissiongodotstable<name>_atlas_e.png, <name>_emission.gdshader, <name>_emission.tres (+ <name>_atlas.png)
pixienginestable<name>_pixi.json (+ <name>_atlas.png, <name>_atlas.json)
phaserenginestable<name>_phaser_atlas.json, <name>_phaser_anims.json (+ <name>_atlas.png, <name>_atlas.json)
love2denginestable<name>.lua, mode8_sprite.lua (the MIT runtime helper) (+ <name>_atlas.png, <name>_atlas.json)
cssenginestable<name>.css, <name>_demo.html (+ <name>_atlas.png, <name>_atlas.json)
indexedenginestable<name>_indexed.png, <name>.hex (+ <name>_atlas.png, <name>_atlas.json)
unityengineexperimental<name>_atlas.png.meta, <name>_<anim>.anim + <name>_<anim>.anim.meta per animation, <name>.controller + <name>.controller.meta (+ <name>_atlas.png, <name>_atlas.json)

Warning

unity is experimental: file contents may change in any minor release. Everything else on this page is stable under the v1 contract.

Formats in detail#

atlas#

The shared packed sprite sheet: a PNG plus TexturePacker-style JSON-hash metadata (frames, meta), with Mode 8's animations and gameplay boxes. Most other formats reuse this atlas.

Stability: stable. Writes for --name hero: hero_atlas.json, hero_atlas.png.

Top-level keys of hero_atlas.json: frames, meta, animations, boxes.

Report section atlas: image, json, size, frames, extrude, power_of_two.

godot#

A Godot 4 SpriteFrames resource whose AtlasTexture regions point into the atlas, one animation per inferred (or --animations) animation. See Godot.

Stability: stable. Writes for --name hero: hero.tres, hero_atlas.png.

Report section godot: tres, atlas_res_path, animations, frames.

gif#

An animated, upscaled preview GIF (--gif-scale, --fps). For eyeballing, not for games.

Stability: stable. Writes for --name hero: hero.gif, hero_idle.gif, hero_walk.gif.

Report section gif: path, fps, scale, frames, animation, transparent, animations.

godot_scene#

A Godot 4 .tscn scene with the sprite, its feet pivot and per-frame hit / hurt boxes (refined by --parts / --facing). See Godot.

Stability: stable. Writes for --name hero: hero.tres, hero.tscn, hero_atlas.png, mode8_actor.gd.

Report section godot_scene: tscn, kind, pivot, body, hitbox_frames, boxes, actor_script, files.

normal#

A palette-quantized normal-map atlas plus a CanvasTexture resource for Godot 2D lighting (--bevel, --strength, --levels). See Lighting Maps.

Stability: stable. Writes for --name hero: hero_atlas.png, hero_atlas_n.png, hero_lit.tres, hero_lit_frames.tres.

emission#

An emission atlas of the glowing pixels plus a Godot shader and material (--emissive and friends). See Lighting Maps.

Stability: stable. Writes for --name hero: hero_atlas.png, hero_atlas_e.png, hero_emission.gdshader, hero_emission.tres.

pixi#

A PixiJS Spritesheet JSON (frames, animations, meta) for PixiJS v7 and v8. Every frame carries a normalized anchor from the feet pivot; per-animation fps / loop live under meta.mode8.

Stability: stable. Writes for --name hero: hero_atlas.json, hero_atlas.png, hero_pixi.json.

Top-level keys of hero_pixi.json: frames, animations, meta.

Report section pixi: spritesheet_json, files, frame_count, animations, pivot_clamped, stability.

phaser#

Phaser 3 files: a JSON-hash atlas with a per-frame feet anchor (load it with this.load.atlas) and Animation Manager JSON (load it with this.load.animation).

Stability: stable. Writes for --name hero: hero_atlas.json, hero_atlas.png, hero_phaser_anims.json, hero_phaser_atlas.json.

Top-level keys of hero_phaser_anims.json: anims, globalTimeScale.

Top-level keys of hero_phaser_atlas.json: frames, meta, animations, boxes.

Report section phaser: atlas_json, anims_json, files, animations, pivot_clamped, stability.

love2d#

A self-contained Lua module that returns a table (image, frames, animations, pivot, ...), loadable with love.filesystem.load("hero.lua")().

Stability: stable. Writes for --name hero: hero.lua, hero_atlas.json, hero_atlas.png, mode8_sprite.lua.

Report section love2d: module_lua, runtime_lua, files, frame_count, animations, stability.

css#

A stylesheet with one class per frame (background-position) and one @keyframes animation per animation, plus a self-contained demo page.

Stability: stable. Writes for --name hero: hero.css, hero_atlas.json, hero_atlas.png, hero_demo.html.

Report section css: stylesheet, demo_html, files, class_prefix, frame_classes, animations, animation_classes, keyframes, stability.

indexed#

A palette-indexed (mode P) PNG of the atlas, index 0 transparent, plus the palette as .hex lines. Pass --palette to fix the color table order.

Stability: stable. Writes for --name hero: hero.hex, hero_atlas.json, hero_atlas.png, hero_indexed.png.

Report section indexed: png, hex, files, colors, transparent_index, stability.

unity#

A Unity TextureImporter .meta that imports the atlas as a pixel-art sprite sheet in Multiple mode, one named sprite per frame (--pixels-per-unit, --guid-namespace).

Stability: experimental. Writes for --name hero: hero.controller, hero.controller.meta, hero_atlas.json, hero_atlas.png, hero_atlas.png.meta, hero_idle.anim, hero_idle.anim.meta, hero_walk.anim, hero_walk.anim.meta.

Report section unity: meta, files, guid, pixels_per_unit, sprite_count, pivot_clamped, clips, controller, stability.

Other generators#

Autotiles, UI kits and bitmap fonts have their own --formats:

CommandFormats (stability)Files
mode8 autotilegodot (stable), tiled (stable)<name>_autotile.png, <name>_autotile.json, <name>_base.png; godot: <name>.tres; tiled: <name>.tsx
mode8 uipng (stable), json (stable), godot (stable)<name>_<piece>.png per piece (png), <name>_ui.json (json), <name>_<piece>_stylebox.tres + <name>_<piece>_texture.tres (icon pieces) + <name>_button_focus_stylebox.tres + <name>_theme.tres + <name>_health_bar.tscn + <name>_preview.tscn (godot); with the builtin font also <name>_font.png + <name>_font.fnt; --preview PNG writes a mock screen
mode8 fontpng (stable), fnt (stable), json (stable)<name>.png (png), <name>.fnt (fnt, AngelCode BMFont text with kerning pairs), <name>_font.json (json)

Versioned manifests#

  • <name>_ui.json, <name>_font.json and <name>_autotile.json carry format_version (their own format, an integer) and mode8_version (the app that wrote them). The autotile JSON also keeps its older app / version keys.
  • The atlas JSON keeps TexturePacker's meta.app / meta.version.
  • A project's layers.json carries version, and mode8.toml carries version (see Project Format).
  • A format version only increases in a major release, unless the change is additive.

Animation timing#

mode8 anim writes a timing sidecar next to its frames, <prefix>.anim.json (report key timing_sidecar). It records each animation's frames, fps and loop. mode8 export and mode8 import of those PNGs read it, so an animation keeps its own frame rate instead of falling back to --fps; export --animations accepts the file too:

bash
mode8 anim hero.png --rig humanoid --out-dir frames --prefix hero
mode8 export frames/ --out-dir out --name hero --formats atlas,godot

The export report names the sidecar it used in timing_sidecar (null when there was none). Every animation gets its own tag in the atlas JSON meta.frameTags, in every engine format.

Quality report#

mode8 lint --quality (MCP mode8_lint with quality, Python check_quality) adds an advisory quality report. Its rules are orphan_pixels, jaggies, ramp_harmony. Its keys:

KeyStability
passstable
scoreexperimental
score_experimentalstable
rulesstable
sizestable
issuesstable
metricsstable

The score ranges 0..10 and is experimental (advisory heuristic; its weighting may change in any release). Metric keys: orphan_pixels, orphan_ratio, flat_orphan_ratio, jaggy_kinks, ramp_count, ramp_issues, near_duplicate_pairs, rare_colors. Each issue has rule, severity, msg, count, pixels.

See also#