Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: FXGLButton

[13:7] extends: Button

Wraps FXGL's FXGLButton, a JavaFX Button subclass that adds the "fxgl-button" style class so it picks up FXGL theme styling. The full JavaFX Button API is reachable through .obj.

Methods

  • FXGLButton (string Text = "")

    Creates a new FXGLButton with the given label text.

    • @p Text is the button label.
  • getText ()

    Returns the button text.

    • @r A string.
  • setText (string Text)

    Sets the button text.

    • @p Text is the new label.
    • @r this object
  • onClick (callback Cb)

    Registers a callback to run when the button is clicked.

    • @p Cb is a callback that takes the ActionEvent string.
    • @r this object