mr-crocs-adventures/tilorswift/js/ButtonTile.js

25 lines
627 B
JavaScript
Raw Permalink Normal View History

import Field from "./Field.js";
import TilorswiftButtonTileClickedEvent from "./events/TilorswiftButtonTileClickedEvent.js";
export default class ButtonTile extends Field
{
constructor(tileset, index = 0)
{
super(tileset, index);
}
initHtml() {
this.htmlElement = document.createElement('div');
this.className = 'field';
this.setupElement();
}
initEventListeners() {
this.htmlElement.addEventListener(
'mousedown',
() => {
window.dispatchEvent(new TilorswiftButtonTileClickedEvent(this));
}
)
}
}