24 lines
557 B
JavaScript
24 lines
557 B
JavaScript
class UI {
|
|
constructor(el, width, height) {
|
|
this.element = el;
|
|
this.setSize(width, height);
|
|
}
|
|
destructor() {
|
|
delete this.element;
|
|
}
|
|
|
|
setPosition(x, y) {
|
|
this.element.style.position = "absolute";
|
|
this.element.style.top = y + "px";
|
|
this.element.style.left = x + "px";
|
|
}
|
|
|
|
setSize(width, height) {
|
|
this._width = width;
|
|
this._height = height;
|
|
this.element.style.width = width + "px";
|
|
this.element.style.height = height + "px";
|
|
}
|
|
}
|
|
|
|
export default UI; |