mr-crocs-adventures/tilorswift/js/menu/TargetPointWidget.js
2020-02-11 21:20:11 +01:00

28 lines
716 B
JavaScript

import Widget from "./Widget.js";
import BrushMode from "../BrushMode.js";
export default class TargetPointWidget extends Widget
{
constructor(widgetBar, brush) {
super('Zielpunkt');
this.widgetBar = widgetBar;
this.brush = brush;
this.htmlElement = this.createElement();
this.htmlElement.addEventListener(
'click',
() => {
this.widgetBar.disableWidgets();
this.enable();
this.brush.mode = BrushMode.EXIT;
}
);
}
createElement()
{
let htmlElement = document.createElement('div');
htmlElement.id = 'target-picker';
return htmlElement;
}
}