mr-crocs-adventures/js/MediaImage.js

14 lines
376 B
JavaScript
Raw Normal View History

2020-01-22 22:50:45 +01:00
import InterfaceEvent from "./events/InterfaceEvent.js";
import ImageLoadedEvent from "./events/ImageLoadedEvent";
export default class MediaImage
{
constructor(filename)
{
this.image = new Image();
this.image.src = filename;
this.image.onload = function () {
window.dispatchEvent(new ImageLoadedEvent(filename));
}
}
}