Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Exporting to your game

Everything that comes out of one drawing has a card of its own in the Export pane: the model for your game, the same model for an editor or a printer, and four pictures. Reach it from the setup panel’s Export tile, or point any pane’s title at it.

Ctrl+E exports the model and Ctrl+Shift+E the artwork, without opening anything.

Exports live inside the project’s folder, so there is nowhere for them to go until the project has one. Until then every button here is drawn inert with the reason in a tooltip.

What ends up in one

A layer you have hidden is in none of these files — not the model, not a picture. The tick in the Outliner is saved with the project, so it means the same thing tomorrow as it does now, and everything written out of here honours it.

A solo is different, and stops short of a model file. It changes what you are looking at — the 3D view, the line art, any picture taken of either — but the .glb, the .bbmodel, the .obj and the .stl are built from every ticked layer regardless. Soloing is not saved with the project, so a model file that honoured it would come out differently tomorrow from the same drawing, with nothing in the drawing to say why.

A faded layer comes out solid, everywhere but the artwork PNG — and there only because that file is the 2D canvas written out. See Layers and depth.

The cards

3D model

<prefix>.glb and <prefix>.meshes.json — the extruded model and the sidecar naming its parts, ready for a game to load. This is the one the app exists for.

The .glb holds the mesh, an embedded PNG atlas, and a node hierarchy of sprite → layer → island.

The sidecar exists because raylib’s Model has no mesh names, only a Meshes array. It maps index to island so you can find “the sword” in a model without counting. Island names are numbered per layer, so look parts up by path ("face/part_1") rather than by bare name.

Unlit material is the card’s one switch. On, the file tells whoever opens it to draw your colours exactly as painted — no lighting, no shadows — which is how Flatty’s own 3D view shows them. Blender honours it, and so does any engine that understands unlit glTF; raylib has never heard of it and lights the model as it always did, so the switch costs a raylib game nothing either way. It is a preference rather than a project setting: it says how an engine should light the file, and one game wants the same answer for every export.

For editors

The same model for somebody who wants to keep working on it.

Export for Blockbench (BBMODEL) writes <prefix>.bbmodel, a Blockbench project that opens with no importer and no plugin: every layer a group, every piece a mesh of quads, the texture inside the file. Reach for this whenever Blockbench is where the model is going — it is the only route on which nothing is guessed on the way in.

Export 3D model (OBJ) writes three files that only work together:

FileIs
<prefix>.objthe geometry, as quads
<prefix>.mtlthe material file the .obj names
<prefix>.atlas.pngthe texture the material names

Delete either companion and the model imports untextured — that is how OBJ works, and every program that reads it expects the three side by side.

In Blender, set the texture to Closest. An OBJ has no way to ask for nearest-neighbour sampling, so Blender’s importer leaves the image on Linear and a small atlas blurs across the faces, with a dark fringe round every one where the edge of a pixel is averaged with the transparency beside it. Select the material, find the Image Texture node, and change Interpolation to Closest; the blur and the fringe go together. The button’s tooltip says the same, since the file cannot.

3D print

Export for printing (STL) writes <prefix>.stl: the model as one closed solid, ready for a slicer, at one millimetre per pixel — a 32-pixel sprite arrives 32 mm across. Px / unit does not apply here; it says how big the model is in a game world, not on a desk.

Layers that overlap or sit inside one another come out as one body, with nothing left inside — a printer needs a single watertight surface, and that is what this writes. The solid is white in every viewer, because STL carries geometry and nothing else, and it stands where the pivot puts it: bottom-centre rests the lowest point on the ground, Center in the Project pane centres it instead.

Artwork

<prefix>.png — the 2D canvas as painted, composited flat, at its own pixel size. The sprite, in other words.

Line art

<prefix>.svg, and <prefix>.vector.png for the same drawing rasterised.

The renderer and the style live in the Vector pane — this card only writes what that pane is set up to draw. Image size is the long edge of the PNG; the SVG is a vector file and has no pixel size to give.

3D view

<prefix>.view.png — a photograph of the 3D view in this workspace, without the ground under it. The picture is the model; a floor belongs to your workspace rather than to the thing you are exporting.

ControlDoes
Image sizethe long edge
Shapethe same shape as the view, or a fixed one. The camera looks up and down by a fixed amount, so the shape decides how much is visible to the sides
Transparent backgroundon by default — the model alone, with nothing behind it, which drops onto a store page or a README without a rectangle round it

The card says which 3D pane it is following, and if there is no 3D view in this workspace it holds the last angle rather than refusing.

There is a camera key on the 3D pane itself that writes the same picture, which is usually the shorter route: you line the shot up, then take it.

A translucent model over nothing composites against transparency, so Lam::pula’s glass comes out darker than it looks in the pane, which clears to an opaque background. Turning the background on is the answer, and is why it is a switch rather than a fact.

Share

Pack for sharing… — see below.

A recording lands here too. The Recorder pane writes its GIFs and videos into the same exports folder under their own names — see Recording. It has its own size, because a film pays for its size on every frame where a picture pays once.

Everything is written twice, on purpose

fluffy cloud/
  exports/
    2026-08-21_144312_fluffy_cloud.glb    kept forever, never overwritten
    2026-08-21_144312_fluffy_cloud.meshes.json
    latest/
      fluffy_cloud.glb                    replaced by every export
      fluffy_cloud.meshes.json

The archive is what stops an export destroying the previous one. The stable copy is what lets your game hard-code a path that does not change every time you press the button.

Point rl.LoadModel at exports/latest/.

Both copies are the same model. The scene name, the root node and the atlas all take the project’s prefix — deliberately not the filename — so a consumer reading the scene name does not see it change because a timestamp did. The sidecar is the one thing that differs: each copy names the .glb sitting beside it.

Show folder opens the exports folder in your file manager, and Show the folder afterwards does it on every export, with the file it just wrote picked out where your desktop can do that.

Prefix

The Prefix field is what the export files are called. It follows the project’s Name automatically until you edit it yourself, at which point it stops tracking — silently renaming somebody’s files is worse than letting the two drift apart. The card says which of the two is happening.

The slug that turns a Name into a Prefix folds accents rather than deleting them: Zażółć becomes zazolc, not z.

Pivot and scale

Both are in the Project pane, under World placement.

Px / unit sets the scale: at 16, a 64-pixel sprite becomes 4 world units.

The pivot defaults to bottom-centre, so DrawModel(m, pos, ...) puts a character’s feet at pos.

Draw your character touching the bottom of the canvas. X and Y come from the canvas, not from the artwork’s tight bounds. That is deliberate: an animation’s frames must share an origin, and tight bounds would move it every time the silhouette changed.

Loading it in raylib

m := rl.LoadModel("sprites/fluffy cloud/exports/latest/fluffy_cloud.glb")

// The one line you have to add. The file asks for nearest-neighbour filtering in
// its glTF sampler, but raylib's loader does not apply glTF samplers — so
// without this your pixels come out smoothed.
for _, mat := range m.GetMaterials() {
    if tex := mat.GetMap(rl.MapAlbedo).Texture; tex.ID != 0 {
        rl.SetTextureFilter(tex, rl.FilterPoint)
    }
}

rl.DrawModel(m, playerPos, 1, rl.White)  // the pivot is baked in

That is the whole integration. No conversion step, no import settings, no material to rebuild.

Opening the .glb in Blender

If the model imports grey, switch the viewport out of Solid shading — press Z and pick Material Preview, or click the third sphere at the top right of the 3D viewport.

Blender’s default Solid mode ignores materials entirely and shows every mesh in flat grey, which looks identical to a model that genuinely has no texture. The file is fine.

A lighter band running diagonally across the model is Blender’s lighting, not your texture. Material Preview lights the model from a studio environment and lets the front layer cast a shadow on the layer behind it; the band is the strip that is not in shadow, and it crosses several faces as one straight line, which no texture could do. Switch to Solid shading with Lighting: Flat and it goes. Better, turn on Unlit material before exporting: Blender then draws the colours as painted, exactly as the 3D pane does.

Blockbench opens the .glb through its glTF plugin, and the export is laid out so that it does; the .bbmodel is still the better door, because it arrives as quads with its layers already grouped.

Transparency

If any texel in the atlas is translucent, the material is written with alphaMode: "BLEND". If none is, no alphaMode key is written at all and the model behaves exactly as an opaque one. The Unlit material switch changes neither: it takes the lighting away and leaves the transparency exactly as it was.

See Colour for why, and what blending costs.

Packing a project up to send

Pack for sharing… asks for a new, empty folder and copies the project into it along with every library asset it uses — the textures and palettes that otherwise live in your folders rather than in the project. Zip that folder and it is a complete handover. See Your libraries.

Exporting without opening the window

For build scripts:

flatty -open ./sprites/cloud -export     # write exports/ and exports/latest/
flatty -project ./sprites/cloud -save    # create the project file

Both run headless and exit. They need somewhere to write, so they refuse to run without -project or -open rather than inventing a path — and neither touches your settings or your recent-project list on the way through.