Button.js 391 B

123456789101112131415161718192021
  1. class Button extends UIObject
  2. {
  3. constructor(name, label = "Button")
  4. {
  5. super(name);
  6. this.P5Element = createButton();
  7. this.label = label;
  8. this.P5Element.html(label);
  9. this.P5Element.position(0, 0);
  10. this.connectCallbacks();
  11. }
  12. setLabel(label)
  13. {
  14. this.label = label;
  15. this.P5Element.html(label);
  16. }
  17. }