Created
June 23, 2021 09:19
-
-
Save ste2425/8637ff41f3886c6813da829cda1e037c to your computer and use it in GitHub Desktop.
Offset TileMap for fonts used in GBDK-2020
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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