Add non-working menu buttons
This commit is contained in:
parent
435b24cb6a
commit
6223b35536
6 changed files with 43 additions and 9 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue