Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: FXGLScene

[20:7] extends: Scene

Wraps FXGL's FXGLScene, the abstract base for every FXGL-engine scene (GameScene, LoadingScene, FXGLMenu). FXGLScene adds a Viewport, padding rectangles, and shortcuts for setting the cursor and background. The constructor requires a running FXGL engine because it reads the application width / height from FXGL.getAppWidth / getAppHeight at init time. Aussom users hold an FXGLScene wrapper via adopt after obtaining one from the engine; direct construction from Aussom is not supported here.

Methods

  • FXGLScene ()

    Empty default constructor; populated by adopt.

  • adopt (object Ajo)

    Wraps an existing FXGLScene AussomJavaObject.

    • @p Ajo is an AussomJavaObject around an FXGLScene.
    • @r A new wrapper.
  • getAppWidth ()

    Returns the application width passed at scene construction.

    • @r An int.
  • getAppHeight ()

    Returns the application height passed at scene construction.

    • @r An int.
  • setBackgroundColor (object ColorObj)

    Sets the scene background to a solid color.

    • @p ColorObj is a Color wrapper.
    • @r this object
  • getViewport ()

    Returns the scene's Viewport (used for camera pan / zoom / follow). The Viewport is the standard way for game code to scroll the game scene around the world.

    • @r An AussomJavaObject around a Viewport.
  • getWidth ()

    Returns the scaled scene width in pixels.

    • @r A double.
  • getHeight ()

    Returns the scaled scene height in pixels.

    • @r A double.
  • getPaddingTop ()

    Returns the top padding rectangle (used for letterboxing).

    • @r An AussomJavaObject around a JavaFX Rectangle.
  • getPaddingBot ()

    Returns the bottom padding rectangle.

    • @r An AussomJavaObject around a JavaFX Rectangle.
  • getPaddingLeft ()

    Returns the left padding rectangle.

    • @r An AussomJavaObject around a JavaFX Rectangle.
  • getPaddingRight ()

    Returns the right padding rectangle.

    • @r An AussomJavaObject around a JavaFX Rectangle.
  • setCursor (object CursorObj)

    Sets the scene mouse cursor.

    • @p CursorObj is an AussomJavaObject around a JavaFX Cursor.
    • @r this object
  • setImageCursor (object ImageObj, double HotspotX, double HotspotY)

    Sets a custom image cursor with a hotspot.

    • @p ImageObj is a fx.Image wrapper.
    • @p HotspotX is the hotspot X.
    • @p HotspotY is the hotspot Y.
    • @r this object
  • setCursorInvisible ()

    Hides the cursor while it is over this scene.

    • @r this object
  • isCursorInvisible ()

    Returns whether the cursor is currently set invisible.

    • @r A bool.
  • activeProperty ()

    Returns the active-state BooleanProperty for this scene (true while the scene is on top of the scene stack).

    • @r An AussomJavaObject around a BooleanProperty.
  • setEffect (object EffectObj)

    Applies a JavaFX Effect to the scene root.

    • @p EffectObj is an AussomJavaObject around an Effect, or null to clear.
    • @r this object
  • getEffect ()

    Returns the current scene Effect.

    • @r An AussomJavaObject around an Effect, or null.
  • clearEffect ()

    Clears any applied Effect.

    • @r this object
  • appendCSS (string Css)

    Appends a stylesheet by URL string to the scene.

    • @p Css is the stylesheet URL.
    • @r this object
  • clearCSS ()

    Clears every stylesheet from the scene.

    • @r this object
  • setBackgroundRepeat (string ImageName)

    Sets the scene background to a tiled image by name (looked up through the AssetLoader).

    • @p ImageName is the image asset name.
    • @r this object
  • setBackgroundRepeatImage (object ImageObj)

    Sets the scene background to a tiled JavaFX Image.

    • @p ImageObj is a fx.Image wrapper.
    • @r this object