How to make a sprite sheet for Phaser, Godot and Unity (free, in your browser)
Pack your animation frames into one sprite sheet, then get it playing in Phaser 3, Godot 4 or Unity. Free, no upload, with the exact numbers to type in each engine.
By Duangduean Studios · 8 min read
What a sprite sheet is, and which kind you need
A sprite sheet is one image that holds every frame of an animation. Your game loads one texture instead of dozens of small files, then draws one rectangle of it at a time. That is faster to load and easier to manage.
There are two kinds. A grid sprite sheet gives every frame the same cell, so any engine can slice it with just a frame size. A packed texture atlas squeezes differently sized images together, sometimes trimming or rotating them, and needs a data file to find each one. For a character walk cycle, an explosion or a coin spin, a grid sheet is the simple, reliable choice. That is what this guide makes.
Prepare your frames
- Export each frame as its own PNG with a transparent background. Aseprite, Krita, Photoshop, Piskel and most AI image tools can do this.
- Make every frame the same width and height, with the character in the same spot. Different sizes make the animation jump.
- Name the files in play order, for example walk-01.png to walk-08.png, so they are easy to select in sequence.
- No art yet? The packer has a built-in four-frame slime you can practise with.
Pack the frames
Example: four 32 × 32 frames with 2 px padding give 36 × 36 cells. In one row of four, the sheet is 144 × 36 px. The first frame starts at x = 2, the second at x = 38, and so on.
- Open the free sprite sheet packer and choose your frames (or click Try slime example).
- Set Columns. A single row (columns = number of frames) is easiest to read; use more rows for long animations so the sheet stays under 4096 px.
- Set Padding to 1 or 2 pixels. A little transparent space around each frame stops neighbouring frames bleeding in when the sprite is scaled.
- Watch the animation preview and drag the speed slider until it feels right. Note the FPS: you will reuse it in your engine.
- Download the PNG. If you use Phaser or PixiJS, also download the JSON for Phaser / PixiJS.
- Write down the numbers under the preview: frame size, columns, rows, and the Unity and Phaser grid values.
Phaser 3
Load the PNG and the atlas JSON together, then create an animation from every frame in the atlas. The frame names are numbered (001, 002 …) so they stay in order.
If you skipped the JSON, load the PNG as a spritesheet instead: this.load.spritesheet("slime", "sprite-sheet.png", { frameWidth: 32, frameHeight: 32, margin: 2, spacing: 4 }). Use the margin and spacing values shown under the preview.
// preload()
this.load.atlas("slime", "sprite-sheet.png", "sprite-sheet.json");
// create()
this.anims.create({
key: "bounce",
frames: this.anims.generateFrameNames("slime"),
frameRate: 8,
repeat: -1,
});
this.add.sprite(200, 200, "slime").setScale(4).play("bounce");Godot 4
- Drag the PNG into your project's FileSystem panel.
- Quick way: add a Sprite2D, set its Texture to the PNG, open the Animation section and set Hframes and Vframes to the columns and rows from the packer. Change Frame to step through the animation, or animate Frame with an AnimationPlayer.
- Animated way: add an AnimatedSprite2D, create a new SpriteFrames resource, open the SpriteFrames panel and click Add frames from a sprite sheet. Enter the same horizontal and vertical counts, select all frames and click Add. Set the animation speed to the FPS you chose in the preview.
- For pixel art, set Texture Filter to Nearest on the node (or project-wide under Rendering, Textures) so it stays sharp.
Unity
- Drag the PNG into your Assets folder and select it.
- In the Inspector set Texture Type to Sprite (2D and UI) and Sprite Mode to Multiple. For pixel art, set Filter Mode to Point (no filter) and Compression to None, then click Apply.
- Click Sprite Editor, open Slice, choose Grid By Cell Size, and enter the pixel size, offset and padding shown under the packer preview (for the slime example: 32 × 32, offset 2, padding 4). Click Slice, then Apply.
- Expand the PNG in the Project window, select all the sliced frames and drag them into the Scene. Unity asks where to save a new animation clip and sets it up for you.
- Open the clip in the Animation window and adjust Samples (frames per second) to match your preview speed.
Common problems and quick fixes
- Blurry pixel art: switch texture filtering to Nearest (Godot) or Point (Unity), and in Phaser set pixelArt: true in the game config.
- Thin lines from the next frame at the edges: add 1–2 px of padding and re-export.
- The animation jumps or wobbles: your frames are different sizes or the character is not in the same spot in each one. Re-export them on a fixed canvas.
- Frames play in the wrong order: select the files in play order, or rename them with leading zeros (01, 02 … 10).
- The sheet is too big: use more rows, smaller frames or less padding. Keeping sheets at 4096 × 4096 or smaller is safest for mobile.
Frequently asked questions
What is the best free sprite sheet packer?
For animations, a free browser-based grid packer is usually all you need: it makes an even grid that Phaser, PixiJS, Godot and Unity can slice. For large sets of mixed-size images, a texture atlas packer that trims and rotates images saves more memory.
Should all sprite frames be the same size?
Yes, for animations. Equal frame sizes keep the character steady and let engines slice the sheet with a single frame size.
How much padding should a sprite sheet have?
1 to 2 pixels of transparent padding around each frame is enough for most 2D games and stops neighbouring frames bleeding in when sprites are scaled.
What is the maximum sprite sheet size?
Many devices handle 4096 × 4096 textures, and that is a safe upper limit for web and mobile games. Smaller sheets load faster.