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`).
{
"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`).
| Key | Type | Default | Means |
|---|---|---|---|
$schema | string | — | — |
sprites | grid | — | 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()`. |
fields | grid | — | The grid of the atlas of the field tiles. road.json names a tile of it by its cell. |
font | string | — | 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.
| Key | Type | Default | Means |
|---|---|---|---|
colsrequired | integer, 1 to 65536 | — | — |
rowsrequired | integer, 1 to 65536 | — | — |
pxWidthrequired | integer, 1 to 4294967295 | — | — |
pxHeightrequired | 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.
| Key | Type | Default | Means |
|---|---|---|---|
pages | array of string | — | The image files of the font. The engine draws one atlas, so a font of more than one page is refused. |
commonrequired | object | — | — |
charsrequired | array of char | — | — |
common
| Key | Type | Default | Means |
|---|---|---|---|
pages | integer = 1 | — | — |
scaleWrequired | 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`). |
scaleHrequired | 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`). |
lineHeightrequired | integer, at least 1 | — | The height of one line, in pixels. |
baserequired | 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.
| Key | Type | Default | Means |
|---|---|---|---|
idrequired | integer, 0 to 1114111 | — | — |
xrequired | integer, at least 0 | — | — |
yrequired | integer, at least 0 | — | — |
widthrequired | integer, at least 0 | — | — |
heightrequired | integer, at least 0 | — | — |
xoffsetrequired | integer | — | — |
yoffsetrequired | integer | — | — |
xadvancerequired | integer | — | — |