Game development
Godot atlas grid planner
Calculate TileSetAtlasSource grid size with margins and separation.
Your inputs
Start with an exampleYour result
Example resultAa — A small example of your colors.
How it works
Columns = floor((width − marginX + separationX)/(tileWidth + separationX)); use the same calculation vertically.
A 256×128 texture with 32×32 regions, no margins and no separation fits 8×4 tiles.
Limits
Godot margins offset the grid origin; they are not a border subtracted twice. Internal texture padding does not change this source grid.