Switch to rollup for bundling
This commit is contained in:
parent
fc8d282509
commit
cfe9c55c9a
16 changed files with 131 additions and 7 deletions
25
js/gui/element.mjs
Normal file
25
js/gui/element.mjs
Normal 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();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue