Add non-working menu buttons

This commit is contained in:
asraelite 2018-03-02 19:56:29 +00:00
parent 435b24cb6a
commit 6223b35536
6 changed files with 43 additions and 9 deletions

View file

@ -1,9 +1,11 @@
import * as gui from './index.mjs';
import GuiElement from './element.mjs';
export class GuiButton extends gui.GuiElement {
constructor(x, y, text, onclick) {
let textSize = gui.measureText(text, 'Arial 14pt');
super(x, y, ...textSize);
export default class GuiButton extends GuiElement {
constructor(text, onclick, x, y, w = 100, h = 30) {
super(x, y, w, h);
this.type = 'button';
this.text = text;
this.onclick = onclick;
}
}