Switch to rollup for bundling

This commit is contained in:
asraelite 2018-03-02 17:23:19 +00:00
parent fc8d282509
commit cfe9c55c9a
16 changed files with 131 additions and 7 deletions

25
js/gui/element.mjs Normal file
View file

@ -0,0 +1,25 @@
const defaultOptions = {
draw: true // Whether the element itself will be rendered.
}
export default class GuiElement {
constructor(x, y, w, h, options) {
this.x = x;
this.y = y;
this.w = w;
this.h = h;
this.children = new Set();
this.parent = null;
this.options = Object.assign(options, defaultOptions);
}
append(element) {
this.children.add(element);
element.parent = this;
}
clear() {
this.children.clear();
}
}