14 lines
376 B
JavaScript
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));
|
||
|
}
|
||
|
}
|
||
|
}
|