Skip to main content
The Phaser 3 format writes a single JSON file containing a textures array. Each entry in the array represents one atlas sheet and carries its own image, size, scale, and frames array. This matches the layout Phaser 3 expects from scene.load.multiatlas(). Single-sheet packs still produce a textures array with one entry, so you can always load with multiatlas regardless of whether multipack is on.

Usage

fastpack pack sprites/ --data-format phaser3

Output format

Single sheet

Standard single-sheet output:
{
  "textures": [
    {
      "image": "atlas.png",
      "format": "RGBA8888",
      "size": { "w": 512, "h": 256 },
      "scale": 1.0,
      "frames": [
        {
          "filename": "player/idle",
          "frame": { "x": 2, "y": 2, "w": 64, "h": 96 },
          "rotated": false,
          "trimmed": true,
          "spriteSourceSize": { "x": 4, "y": 0, "w": 64, "h": 96 },
          "sourceSize": { "w": 72, "h": 96 }
        }
      ]
    }
  ],
  "meta": {
    "app": "FastPack",
    "version": "3.0"
  }
}

Multi-sheet (multipack)

Multi-sheet output writes two entries in textures but only one JSON file:
{
  "textures": [
    {
      "image": "atlas.png",
      "format": "RGBA8888",
      "size": { "w": 4096, "h": 4096 },
      "scale": 1.0,
      "frames": [ "..." ]
    },
    {
      "image": "atlas1.png",
      "format": "RGBA8888",
      "size": { "w": 1024, "h": 512 },
      "scale": 1.0,
      "frames": [ "..." ]
    }
  ],
  "meta": { "app": "FastPack", "version": "3.0" }
}

Loading in Phaser 3

function preload() {
  this.load.multiatlas('sprites', 'atlas.json', 'assets/');
}

Schema reference

Texture entry

image
string
required
Texture filename (e.g., atlas.png, atlas1.png)
format
string
required
Pixel format (e.g., RGBA8888, RGB888)
size
object
required
Atlas dimensions
w
number
Width in pixels
h
number
Height in pixels
scale
number
required
Scale factor used during packing. Phaser uses this to apply sub-pixel corrections when mixing @1x and @2x atlases.
frames
array
required
Array of frame objects for this texture sheet

Frame object

filename
string
required
Sprite ID (source path without extension)
frame
object
required
Rectangle in the atlas texture (x, y, w, h in pixels)
rotated
boolean
required
true when the sprite was rotated 90° clockwise
trimmed
boolean
required
true when transparent borders were stripped
spriteSourceSize
object
required
Frame’s position and size relative to the original source image
sourceSize
object
required
Full original image dimensions before trimming

Meta object

meta
object
required
Atlas metadata
app
string
Always "FastPack"
version
string
Format version ("3.0" for Phaser 3)

Multipack support

When multipack is active, the Phaser 3 exporter combines all sheets for a scale variant into a single JSON file. Secondary sheets do not get their own data files; only one .json is written per variant.
Each textures entry has its own scale field that reflects the ScaleVariant.scale used during packing. This allows Phaser to correctly handle mixed-resolution atlases.

TexturePacker compatibility

TexturePacker also produces this format when targeting Phaser 3. The meta.app field reads "FastPack" instead of "TexturePacker"; Phaser ignores the app field. Frame fields use camelCase (spriteSourceSize, sourceSize) to match Phaser’s parser.

Build docs developers (and LLMs) love