title: Clicking or hovering over multiple images in canvas?
body: <p>I am working on a project for my programming class. I'd like to essentially have a canvas with a background element (say a room.jpg) and then maybe three interactive objects in the room (lamp.jpg, couch.jpg, desk.jpg). I'd like for it to be that if you hover over the lamp a small box or text pops out, giving you some information. Or maybe have it so if you click an image, the same concept happens. You know, something interactive with the objects in the canvas. Again, I'm new to canvas but we have to use it in our assignment. My current code is:</p>
  
  <pre><code>function loadImages(sources, callback) {
              var images = {};
              var loadedImages = 0;
              var numImages = 0;
              // get num of sources
              for(var src in sources) {
                  numImages++;
                  }
              for(var src in sources) {
                  images[src] = new Image();
                  images[src].onload = function() {
                  if(++loadedImages &gt;= numImages) {
                  callback(images);
                      }
                  };
              images[src].src = sources[src];
                  }
              }
  
              var sources = {
              room: 'room.jpg',
              title: 'title.jpg'
              };
  
              loadImages(sources, function(images) {
              context.drawImage(images.room, 0,0);
              context.drawImage(images.title, 0,0);
              });
              }
  </code></pre>
  
  <p>But from what I understand, it makes the two jpegs a "permanent" canvas element (unable to be messed with). I had been trying to get it so that when I clicked I'd go from the title.jpg to the room.jpg but I've since given up. Essentially, all I want now is just to have the room.jpg appear when the page is first loaded, and have three other png objects on top (as objects in the room). Are these able to be interacted with, or do I have to put the images into the canvas in another way? Thanks for all your help  and your patience!</p>