Skip to content

Instantly share code, notes, and snippets.

@ste2425
Created June 23, 2021 09:19
Show Gist options
  • Save ste2425/8637ff41f3886c6813da829cda1e037c to your computer and use it in GitHub Desktop.
Save ste2425/8637ff41f3886c6813da829cda1e037c to your computer and use it in GitHub Desktop.
Offset TileMap for fonts used in GBDK-2020
/*
font tiles in GBDK are always inserted at the start.
This script will offset existing tile maps by the number of
tiles in the font.
*/
const fontTileSize = 37;
const tileMap = [/* Tile map array of hex values */];
const parsed = tileMap
.map(t => {
const parsed = parseInt(t) + fontTileSize;
return `0x${parsed.toString(16)}`;
})
.join(',');
document.body.textContent = parsed;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment