level-editor thumbnails


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 Play in browser
Mar 09, 2021

Leave a comment

Log in with itch.io to leave a comment.