Skip to content

inferTilesetGrid

inferTilesetGrid(dimensions, cols, rows): object

Defined in: packages/declarative-hex-worlds/src/asset-source/png-dimensions.ts:61

Infer a tileset grid from the atlas dimensions + a known column/row count. The common case: the author knows the sheet is cols × rows cells (the CLI takes --cols/--rows), and the cell size is the exact integer division of the atlas. Throws if the dimensions don’t divide evenly — a mismatch means the cols/rows are wrong and the emitted grid would mis-slice every cell.

PngDimensions

number

number

object

cellHeight: number

cellWidth: number

cols: number

rows: number