Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: ScrollingBackgroundView

[19:7] extends: ScrollingView

Wraps FXGL's ScrollingBackgroundView (com.almasb.fxgl.dsl.views.ScrollingBackgroundView), a scrolling view that auto-binds to the running game's viewport. As the viewport scrolls, the background scrolls proportionally (and tiles seamlessly). Must be constructed inside a running FXGL game (uses FXGL.getGameScene()).

Methods

  • ScrollingBackgroundView (object ImageObj = null, double ViewWidth = 800.0, double ViewHeight = 600.0, string Orientation = "HORIZONTAL", double Speed = 1.0)

    Creates a new ScrollingBackgroundView.

    • @p ImageObj is a javafx.scene.image.Image AJO (use fxgl.image(name) to load by asset name).
    • @p ViewWidth is the rendered width in pixels.
    • @p ViewHeight is the rendered height in pixels.
    • @p Orientation is "HORIZONTAL" or "VERTICAL".
    • @p Speed is the per-viewport-pixel scroll multiplier.
  • adopt (object Ajo)

    Wraps an existing ScrollingBackgroundView AussomJavaObject.