DefoldPNG grid workflow

Sprite Sheet Generator for Defold

Defold builds its own atlases, so it wants a clean grid PNG. Export one, point a Tile Source at it, and define your animation groups.

A sprite sheet exported as a uniform PNG grid, next to the settings it needs in Defold
What you export

Format menu

PNG

Uniform PNG grid

Defold has two asset paths. An Atlas takes individual images and packs them itself, and a Tile Source takes one grid sheet and cuts it by tile size. For a sheet built here, Tile Source is the direct route: tile width, tile height, and optional margin and spacing are the only inputs, and animation groups are defined on top of the resulting tiles.

Step by step

Getting the sheet into Defold

  1. 1

    Export a uniform grid

    Keep cells identical and note the cell size plus any gutter. Export the PNG.

  2. 2

    Add it to the project

    Drop the PNG into your Defold project folder. It shows up in the assets pane immediately.

  3. 3

    Create a Tile Source

    New > Tile Source, set Image to your PNG, and set Tile Width and Tile Height to your cell size. Set Inner Padding and Extrude Borders if you exported a gutter.

  4. 4

    Define animation groups

    In the tile source, add an Animation, set start and end tile, FPS, and playback mode.

  5. 5

    Point filtering

    In game.project under Graphics, set the default texture min and mag filter to nearest so pixel art stays sharp.

Lua
function init(self)
    sprite.play_flipbook("#sprite", "idle")
end

function on_input(self, action_id, action)
    if action_id == hash("right") then
        sprite.play_flipbook("#sprite", "walk")
    end
end
Cheat sheet
SettingDefold value
Asset typeTile Source (.tilesource)
Cell sizeTile Width / Tile Height
GutterInner Padding, plus Extrude Borders
AnimationAnimation group: start tile, end tile, FPS
Crisp pixelsgame.project > Graphics > filters: nearest
Built for the workflow

Regular grid guaranteed

Tile Source assumes every tile is the same size. The packer here gives you exactly that.

Predictable tile indices

Tiles number left to right, top to bottom, which is the frame order you arranged, so animation start and end indices are easy to read off.

Padding you can declare

Whatever gutter you export becomes the Inner Padding value. No reverse-engineering the sheet.

Timing preview

Preview the loop at your target FPS before you set it on the animation group.

Defold FAQ

Want the long version? Read the engine import guide, or see every export format.

Other engines

Export for Defold

Pack your frames in the browser. What you walk away with: Uniform PNG grid, ready for Defold.