mr-crocs-adventures/js/MediaImage.js
2020-01-22 22:50:45 +01:00

14 lines
376 B
JavaScript

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));
}
}
}