Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: Console

[19:7] extends: Pane

Wraps FXGL's Console (com.almasb.fxgl.dev.Console), a Pane subclass that renders the developer console (text output area, command input field, built-in help / clear / exit / set / vars commands). Owned by the DevService; not normally constructed by game code. The Pane base means it can be added to any JavaFX layout via .obj when used outside the engine's overlay (mostly for tests).

Methods

  • Console (bool Construct = true)

    Creates a new Console. Pass false to construct an empty wrapper for adopt; the default (true) instantiates the engine class, which requires the FXGL UI factory to be available.

    • @p Construct is true to instantiate immediately, false for an empty wrapper.
  • adopt (object Ajo)

    Wraps an existing Console AussomJavaObject.

    • @p Ajo is an AussomJavaObject around a Console.
    • @r A new wrapper.
  • isOpen ()

    Returns true while the console is attached to a scene.

    • @r A bool.
  • open ()

    Opens the console (adds it to the running GameScene's UI layer and disables normal input registration).

    • @r this object
  • close ()

    Closes the console (removes it from the GameScene UI layer and re-enables input registration).

    • @r this object
  • pushMessage (string Message)

    Appends a message to the console output (added on the JavaFX UI thread).

    • @p Message is the line of text to add.
    • @r this object