Reference

The atlas file and the font

atlas.json says how your images are cut: the grid of the sprite sheet, the grid of the field tiles, and the font of the signs. The tables list every key of its schema, and of the font file it names. The site reads them from the schema files when it builds.

atlas.json

The atlas of a moveby page and the font of its signs. This schema holds the rules of shape. The reader (packages/moveby-build/src/atlas.ts) reads it at build. Each key is optional: a page with no image, no field and no sign needs none of them. The command says which key a scene or a road needs (`ATLAS_MISSING`).

atlas.json
{
  "sprites": { "cols": 8, "rows": 8, "pxWidth": 128, "pxHeight": 128 },
  "fields": { "cols": 2, "rows": 2, "pxWidth": 128, "pxHeight": 128 },
  "font": "minecraft_fnt.json"
}

moveby atlas

The atlas of a moveby page and the font of its signs. This schema holds the rules of shape. The reader (packages/moveby-build/src/atlas.ts) reads it at build. Each key is optional: a page with no image, no field and no sign needs none of them. The command says which key a scene or a road needs (`ATLAS_MISSING`).

KeyTypeDefaultMeans
$schemastring——
spritesgrid—The grid of the sprite atlas. An image of the scene takes its look from a cell of it: the page gives the cell with `asset()`.
fieldsgrid—The grid of the atlas of the field tiles. road.json names a tile of it by its cell.
fontstring—The BMFont file of the scene's signs, in its JSON text form. The path is relative to the folder of this file.

grid

One atlas image: `cols` by `rows` cells, all of one size, in an image of `pxWidth` by `pxHeight` pixels. The track file holds the four numbers as 32-bit counts.

KeyTypeDefaultMeans
cols
required
integer, 1 to 65536——
rows
required
integer, 1 to 65536——
pxWidth
required
integer, 1 to 4294967295——
pxHeight
required
integer, 1 to 4294967295——

The font file

A BMFont file in its JSON text form, as the BMFont tool writes it. This schema holds the rules of shape of the fields the build reads. Every other key is free to be there: the build ignores it, `kernings` among them, because the engine has no kerning.

moveby font

A BMFont file in its JSON text form, as the BMFont tool writes it. This schema holds the rules of shape of the fields the build reads. Every other key is free to be there: the build ignores it, `kernings` among them, because the engine has no kerning.

KeyTypeDefaultMeans
pagesarray of string—The image files of the font. The engine draws one atlas, so a font of more than one page is refused.
common
required
object——
chars
required
array of char——

common

KeyTypeDefaultMeans
pagesinteger = 1——
scaleW
required
side—A side of the atlas, in pixels. The track file holds a glyph's place exactly only when both sides are powers of two. The engine refuses every other font (`WIRE_GLYPH_METRIC`).
scaleH
required
side—A side of the atlas, in pixels. The track file holds a glyph's place exactly only when both sides are powers of two. The engine refuses every other font (`WIRE_GLYPH_METRIC`).
lineHeight
required
integer, at least 1—The height of one line, in pixels.
base
required
integer, at least 0—The distance from the top of a line to the base line, in pixels.

char

One glyph: its codepoint, its rectangle in the atlas, and how the pen places it. Every number is in pixels.

KeyTypeDefaultMeans
id
required
integer, 0 to 1114111——
x
required
integer, at least 0——
y
required
integer, at least 0——
width
required
integer, at least 0——
height
required
integer, at least 0——
xoffset
required
integer——
yoffset
required
integer——
xadvance
required
integer——