mr-crocs-adventures/tilorswift/js/menu/EntrancePointWidget.js

28 lines
724 B
JavaScript
Raw Permalink Normal View History

2020-02-04 23:03:33 +01:00
import Widget from "./Widget.js";
import BrushMode from "../BrushMode.js";
export default class EntrancePointWidget extends Widget
{
constructor(widgetBar, brush) {
super('Startpunkt');
this.widgetBar = widgetBar;
this.brush = brush;
this.htmlElement = this.createElement();
this.htmlElement.addEventListener(
'click',
() => {
this.widgetBar.disableWidgets();
this.enable();
this.brush.mode = BrushMode.ENTRANCE;
}
)
}
createElement()
{
let htmlElement = document.createElement('div');
htmlElement.id = 'entrance-picker';
return htmlElement;
}
}