itch.io is community of indie game creators and players

Devlogs

level-editor thumbnails

Fracas 3
A browser game made in HTML5

In the level editor, I added add thumbnail previews for every level. Each thumbnail is generated by rendering a level on a tiny canvas, and then calling getDataURL(). That data can be used as an <img> src attribute, and presto, thumbnails! They're a little slow to generate, so to make sure the level editor loads quickly, I cache the thumbnails in localstorage (about 4KB each). Thumbnails are re-snapshotted when the thumbnail timestamp doesn't match the last level-edit timestamp - both timestamps are also in localstorage.

Files

  • fracas3.zip 310 kB
    Mar 09, 2021
Leave a comment