Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: ErrorSubScene

[20:7] extends: FxglSubScene

Wraps FXGL's ErrorSubScene (com.almasb.fxgl.app.scene.ErrorSubScene), a SubScene used to surface a Throwable with its stack trace and an "Exit game" button. FXGL pushes this sub-scene automatically when an uncaught exception bubbles up; game code can also push one manually to surface a recoverable error. The constructor takes the scene dimensions, the error to display, and a Runnable invoked when the Exit button is pressed.

Methods

  • ErrorSubScene (double SceneWidth = 0.0, double SceneHeight = 0.0, ErrorObj = null, callback Cb = null)

    Creates a new ErrorSubScene. Pass null for ErrorObj to construct an empty wrapper for adopt.

    • @p SceneWidth is the sub-scene width in pixels.
    • @p SceneHeight is the sub-scene height in pixels.
    • @p ErrorObj is an AussomJavaObject around a Throwable, or null for an empty wrapper.
    • @p Cb is a callback with no arguments invoked on Exit.
  • adopt (object Ajo)

    Wraps an existing ErrorSubScene AussomJavaObject.

    • @p Ajo is an AussomJavaObject around an ErrorSubScene.
    • @r A new wrapper.
  • getError ()

    Returns the displayed error.

    • @r An AussomJavaObject around a Throwable.
  • getAction ()

    Returns the on-exit Runnable.

    • @r An AussomJavaObject around a Runnable.
  • getSceneWidth ()

    Returns the sub-scene width.

    • @r A double.
  • getSceneHeight ()

    Returns the sub-scene height.

    • @r A double.