Spritesheet and XML Generator — Starling / Sparrow XML
Sparrow XML stores every frame as a SubTexture with its trim as frameX/frameY; engines such as HaxeFlixel group animations by frame-name prefix. This export writes one XML per page — loaded and drawn by Phaser in the verification run. HaxeFlixel and FNF engines were not tested.
Sparrow / Starling XML (the "spritesheet and XML" of many FNF mods) describes a packed PNG as a TextureAtlas element (imagePath="…") with one SubTexture per frame: name, x, y, width, height, and for trimmed frames frameX, frameY (negative offsets) with frameWidth, frameHeight (the original size). Nerulio writes one XML per page and never rotates. Phaser 4.2 draws trimmed frames correctly; Phaser 3.90 does not, so for Phaser 3 use the "Sparrow XML (Phaser 3)" preset, which turns trim off. HaxeFlixel and FNF engines were not tested.

- Starling / Sparrow XMLVerified· Phaser 4.2
- Godot 4Verified· Godot 4.7.2
- Unity 6Verified· Unity 6000.5.3f1
- Phaser 3 / 4Verified· Phaser 3.90 + 4.2
- PixiJS 8Verified· PixiJS 8.21
- Aseprite JSONVerified· Phaser load.aseprite · PixiJS 8.21
- .asepriteVerified· Aseprite 1.3.18
- Spine / libGDXVerified· spine-canvas 4.2
- LÖVEVerified· LÖVE 11.5
- DefoldBuilt· Defold bob.jar 1.13.1
- GameMakerUNVERIFIED
- CSS spritesVerified· Chromium
- GIF / APNGDecoded· Pillow
Reading a SubTexture
Every frame is one element. x, y, width and height cut the stored pixels out of the page. If the frame was trimmed, frameX and frameY say where the full frame begins relative to those pixels, as negative numbers because the full frame starts up and to the left, and frameWidth, frameHeight give its size.
Animations are not stored in the file; they are built from frame names, for example every SubTexture whose name starts with run_. Phaser does this with generateFrameNames and a prefix, so the names matter more here than in JSON atlases that carry an animation list.
The bug to know: Phaser 3.90's AtlasXML parser passes the trimmed size and the full size to setTrim in the wrong order, so trimmed XML frames are drawn wrong in Phaser 3.90. The same files are drawn correctly in Phaser 4.2. The "Sparrow XML (Phaser 3)" preset turns trim off, so no frame carries frameX/frameY, and it passes in both versions. In Nerulio's engine runs these were the only 2 failures among 49.
- TextureAtlas
- The root element;
imagePathnames the PNG page, with its width and height. - SubTexture
- One frame: its name and rectangle on the page.
- frameX, frameY
- Negative offset of the full frame from the stored pixels (trimmed frames only).
- frameWidth, frameHeight
- Size of the untrimmed frame.
- pivotX, pivotY
- Pivot in pixels on the full frame; Nerulio writes it, Phaser's XML loader does not read it.
Example: one frame in both presets, and the Phaser 3.90 bug
Starling / Sparrow XML preset (trim on), page 38 × 50
SubTexture name="run_0" x="0" y="34" width="18" height="15"
frameX="-10" frameY="-10" frameWidth="40" frameHeight="29" pivotX="20" pivotY="29"
"Sparrow XML (Phaser 3)" preset (trim off), page 82 × 91
SubTexture name="run_0" x="0" y="0" width="40" height="29" pivotX="20" pivotY="29"
Phaser 3.90 AtlasXML calls setTrim(18, 15, 10, 10, 40, 29)
Frame.setTrim expects setTrim(40, 29, 10, 10, 18, 15) (full size first, trimmed size last)
cost of trim off here: 82 × 91 = 7,462 px² instead of 38 × 50 = 1,900 px² (3.9×)Phaser's JSON parser passes sourceSize first and spriteSourceSize last, which is why a trimmed JSON atlas is fine in Phaser 3.90 while the same frames in XML are not.
What it does
- Per-page XML with SubTexture entries, frameX/frameY for trimmed frames and pivots.
- Two presets: Starling / Sparrow XML (trim on) and "Sparrow XML (Phaser 3)" with trim off.
- Phaser 4.2 draws both; Phaser 3.90 mis-draws trimmed XML frames (its own bug), so use the Phaser 3 preset there.
- Rotation refused for this target.
How to do it
- Drop numbered frames, a GIF, an .aseprite file or a sheet (then Apply).
- Check the frame names on the timeline; each one becomes a SubTexture name.
- In Pack & Export choose Starling / Sparrow XML, or Sparrow XML (Phaser 3).
- Load the PNG and XML in your engine.
Files you get
| File | What it is for |
|---|---|
run.xml | TextureAtlas element (imagePath="run.png", width, height) with one SubTexture per frame; frameX, frameY, frameWidth and frameHeight only on trimmed frames; pivotX and pivotY in pixels. |
run.png | The page. With several pages: run-0.png with run-0.xml, run-1.png with run-1.xml, and so on. |
Load it
- Phaser 4.2:
this.load.atlasXML("run", "run.png", "run.xml"), thenthis.add.sprite(x, y, "run", "run_0"); either XML preset works. - Phaser 3.90: export with "Sparrow XML (Phaser 3)" and load it the same way.
- Build the animation from the names:
this.anims.create({ key: "run", frames: this.anims.generateFrameNames("run", { prefix: "run_", start: 0, end: 5 }), frameRate: 10, repeat: -1 }). - Other engines (HaxeFlixel, FNF engines, Starling) read the same SubTexture layout, but they were not run here: compare one trimmed frame with its source image before relying on it.
Troubleshooting
| Symptom | Likely cause | How to check | Fix |
|---|---|---|---|
| Trimmed frames drawn shifted or at the wrong size, only in Phaser 3.90 | Phaser 3.90's AtlasXML passes the trimmed and full sizes to setTrim in the wrong order | The XML has frameX on those frames, and the same files look right in Phaser 4.2 | Use the "Sparrow XML (Phaser 3)" preset (trim off), the JSON atlas (trim works there), or Phaser 4 |
| Frames turned or mirrored | The XML came from a packer that rotated frames (rotated="true"), which Phaser's XML parser does not read | Search the XML for rotated | Repack without rotation; Nerulio's XML export refuses a rotated pack |
| An animation picks up the wrong frames | The prefix is too broad: run_ also matches run_attack_0 | List the frame names in the XML | Give each animation a unique prefix before exporting |
| The sprite's origin ignores the pivot | Phaser's XML loader reads only the rectangle and trim attributes, not pivotX/pivotY | The sprite origin stays at the centre | Call sprite.setOrigin(0.5, 1), or use the JSON atlas, whose pivot Phaser applies as the origin |
Other ways to do it
| Option | When it is the better choice |
|---|---|
| Phaser JSON atlas | For a Phaser game: trim works in 3.90 and 4.2, pivots become sprite origins and an animations file comes with it. See Phaser texture atlas. |
| Preview or convert an existing FNF sheet | To turn a spritesheet + XML you already have into a GIF, see FNF spritesheet to GIF. |
Engine exports and how each was checked
"Verified" means the exported files were loaded by the real engine or tool on real CC0 assets and the result was compared with the source. Anything that was not loaded is labelled as such.
| Target | Files | Check |
|---|---|---|
| Godot 4 | .tres SpriteFrames · .tscn AnimatedSprite2D · .png.import | Verified Godot 4.7.2Loaded by Godot; every animation frame drawn and compared with the source file. The scene uses Nearest filtering; rotation is never used. |
| Unity 6 | .unity.json · Editor/NerulioSpriteImporter.cs · AnimationClip | Verified Unity 6000.5.3f1Batch mode: sprite rects, pivots, pixels, clip keys and durations checked. |
| Phaser 3 / 4 | atlas JSON (multiatlas) · .anims.json | Verified Phaser 3.90 + 4.2Frames and animations drawn by both versions. |
| PixiJS 8 | spritesheet JSON · animations · anchor · meta.scale | Verified PixiJS 8.21Rotated and multi-page atlases included. |
| Aseprite JSON | hash / array · frameTags · slices | Verified Phaser load.aseprite · PixiJS 8.21Tags keep their direction and repeat count. |
| .aseprite | layers · tags · durations · slices | Verified Aseprite 1.3.18Opened and rendered by the Aseprite command line. |
| Spine / libGDX | .atlas | Verified spine-canvas 4.2Every region drawn by the Spine runtime, rotated and trimmed; libGDX itself was not run. |
| Starling / Sparrow XML | XML per page | Verified Phaser 4.2Phaser 3.90 draws trimmed XML frames wrongly (its own bug); the "Sparrow XML (Phaser 3)" preset turns trim off and passes in 3.90 and 4.2. |
| LÖVE | Lua quads · nerulio_atlas.lua · main.lua | Verified LÖVE 11.5Every frame drawn and every animation stepped through the shipped helper. |
| Defold | .atlas · .tilesource | Built Defold bob.jar 1.13.1Built by Defold's command-line builder; the built texture's UVs were read back. |
| GameMaker | spr_<name>_stripN.png · gamemaker.json | UNVERIFIEDNot loaded in GameMaker (no headless GameMaker). The strips are cut the way its strip importer cuts them. |
| CSS sprites | .css · preview .html | Verified ChromiumEvery class drawn from the shipped stylesheet. |
| GIF / APNG | one file per animation | Decoded PillowEvery frame and delay decoded again after export; APNG is exact. |
Evidence
Exports: 49 runs in the real engines on real CC0 assets, 47 pass — the 2 failures are Phaser 3.90's trimmed-XML bug, which the Phaser 3 preset avoids. Packer head-to-head on 5 real frame sets (CodeAndWeb free web packer, GAPTools, free-tex-packer): smallest sheet on all 5 with rotation allowed, 4 of 5 without; every frame restored pixel-exact.
Limits
- Polygon (mesh) packing is not offered: none of the verified engines draws a mesh atlas from exported data.
- GameMaker strips are UNVERIFIED in GameMaker itself.
- Scale variants (@0.5x–@4x) use nearest-neighbour only.
- Trimmed Starling XML is drawn wrongly by Phaser 3.90; use the "Sparrow XML (Phaser 3)" preset there.
Versions and sources
Loaded and drawn by Phaser 3.90.0 and 4.2.1 on the ninja and archer frame sets: the trimmed Starling preset failed only in 3.90 (2 of 49 engine runs), the Phaser 3 preset passed in both. The setTrim argument order is quoted from the Phaser 3.90 source. HaxeFlixel, Starling and FNF engines were not run.
Official documentation used
Questions
Does it work in Friday Night Funkin' / HaxeFlixel?
Not tested: the XML was verified in Phaser only. The format is the same Sparrow XML, but no HaxeFlixel build was run here.
Why does Phaser 3 show my trimmed frames shifted?
Phaser 3.90's XML parser passes the trimmed and full sizes in the wrong order; the "Sparrow XML (Phaser 3)" preset turns trim off and passes in 3.90 and 4.2.
Is it free, and do I need an account?
Everything on these pages is free and works without an account. There is no watermark and no export that is held back.
Are my sprites uploaded?
No. The Studio decodes, packs and exports in this browser tab. Projects are autosaved in the browser (IndexedDB) and can be saved as a .nerulio file.
Does it need Aseprite or an engine plugin installed?
No. .aseprite files are read and written in the browser, and each engine bundle carries what that engine needs (for Godot, the import settings and scene; for Unity and the Godot TileSet, a small editor script).