Image.js 269 B

12345678910111213141516
  1. "use strict";
  2. function Image(src)
  3. {
  4. Object2D.call(this);
  5. this.image = document.createElement("img");
  6. this.image.src = src;
  7. }
  8. Image.prototype = Object.create(Object2D.prototype);
  9. Image.prototype.draw = function(context)
  10. {
  11. context.drawImage(this.image, 0, 0);
  12. };