Canvas Cheat Sheet

HTML5 Canvas Image Loader Tutorial

Discussion

When HTML5 Canvas applications require multiple images, it's usually a good idea to load all of the images before drawing on the canvas. To simplify the loading process, it's convenient to use an image loader function that takes in a hash of image sources, creates an hash of images, and then calls a user defined function whenever all of the images have loaded.