mirror of
https://git.leinelab.org/Mal/mr-crocs-adventures.git
synced 2025-09-11 02:57:36 +02:00
Basic implementations
This commit is contained in:
14
js/MediaImage.js
Normal file
14
js/MediaImage.js
Normal file
@@ -0,0 +1,14 @@
|
||||
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));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user