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.
Code Editor
Modified on April 8th, 2013
by Eric Rowell