Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: SceneService

[16:7] extends: EngineService

Wraps FXGL's SceneService, the engine service that exposes the active scene stack plus scene-related globals (input, timer, event bus, overlay root, preferred width/height). Reached at runtime via fxgl.getSceneService (chunk 6); obtain a wrapper via adopt.

Methods

  • SceneService (Ajo = null)

    Creates a SceneService wrapper. Empty by default; the (Ajo) form wraps an existing instance from fxgl.getSceneService.

    • @p Ajo is an optional AussomJavaObject around a SceneService.
  • adopt (object Ajo)

    Wraps an existing SceneService AussomJavaObject.

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

    Returns the topmost active scene (or subscene).

    • @r A Scene wrapper.
  • pushSubScene (object SubSceneObj)

    Pushes a SubScene onto the scene stack. The current scene keeps rendering underneath; input goes to the new top.

    • @p SubSceneObj is an FxglSubScene wrapper.
    • @r this object
  • popSubScene ()

    Pops the topmost SubScene off the stack.

    • @r this object
  • getPrefWidth ()

    Returns the preferred scene width.

    • @r A double.
  • getPrefHeight ()

    Returns the preferred scene height.

    • @r A double.
  • getOverlayRoot ()

    Returns the overlay Group that is always on top of every other UI element (used for notifications).

    • @r An AussomJavaObject around a javafx.scene.Group.
  • _optScene (rawAjo)

  • prefWidthProperty ()

    Returns the preferred width as a ReadOnlyDoubleProperty for binding HUD layouts to a resizable game.

    • @r An AussomJavaObject around a ReadOnlyDoubleProperty.
  • prefHeightProperty ()

    Returns the preferred height as a ReadOnlyDoubleProperty.

    • @r An AussomJavaObject around a ReadOnlyDoubleProperty.
  • getEventBus ()

    Returns the always-on EventBus shared across every scene.

    • @r An AussomJavaObject around an EventBus.
  • getInput ()

    Returns the always-on Input service. Distinct from a scene's local input -- this one stays active across scene transitions.

    • @r An AussomJavaObject around an Input.
  • getTimer ()

    Returns the always-on Timer (does not pause with the game).

    • @r An AussomJavaObject around a Timer.
  • getIntroScene ()

    Returns the intro Scene as an AussomJavaObject, or null when no intro scene is registered.

    • @r An AussomJavaObject around a Scene, or null.
  • getLoadingScene ()

    Returns the loading Scene, or null.

    • @r An AussomJavaObject around a Scene, or null.
  • getGameScene ()

    Returns the game Scene, or null.

    • @r An AussomJavaObject around a Scene, or null.
  • getMainMenuScene ()

    Returns the main-menu Scene, or null.

    • @r An AussomJavaObject around a Scene, or null.
  • getGameMenuScene ()

    Returns the in-game menu Scene, or null.

    • @r An AussomJavaObject around a Scene, or null.
  • isInHierarchy (object SceneObj)

    Returns whether the given Scene is currently in the active scene-stack hierarchy.

    • @p SceneObj is a Scene wrapper.
    • @r A bool.