Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: View

[23:7] extends: FxObj

Wraps an AussomView (implementation of FXGL's View interface: Updatable + Disposable + getNode) so Aussom code can author a custom updatable scene Node. Pair the Node with onUpdate / onDispose callbacks; the underlying View can then be added to any FXGL container that accepts View instances (e.g. GameScene.addGameView). For the simpler Updatable, Disposable, and Copyable<T> interfaces (single method each), use the existing aji.closure pattern: updatable = aji.closure("com.almasb.fxgl.core.Updatable", cb); disposable = aji.closure("com.almasb.fxgl.core.Disposable", cb); copyable = aji.closure("com.almasb.fxgl.core.Copyable", cb);

Methods

  • View (object NodeObj)

    Creates a View backed by the supplied JavaFX Node.

    • @p NodeObj is a fx.Node wrapper for the view's Node.
  • onUpdate (callback Cb)

    Registers an onUpdate callback (called every frame with tpf seconds).

    • @r this object
  • onDispose (callback Cb)

    Registers an onDispose callback (called when the view is removed).

    • @r this object
  • getNode ()

    Returns the JavaFX Node backing this view.

    • @r An AussomJavaObject around the Node.