Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: NotificationView

[25:7] extends: Pane

Wraps an AussomNotificationView (subclass of FXGL's abstract NotificationView). This is the subclass-extension contract for custom notification renderers: FXGL instantiates the registered NotificationView subclass itself, so the typical production path is to ship a concrete Java/Kotlin subclass and register the class. This wrapper is most useful for tests and for adoption of a view obtained through AJI. Callback signatures: onPlayInAnimation() (no args) onPush(notificationAjo) onPlayOutAnimation() (no args) onUpdate(double tpf)

Methods

  • NotificationView ()

    Creates a new NotificationView bridge.

  • adopt (object Ajo)

    Wraps an existing view AussomJavaObject.

    • @p Ajo is an AussomJavaObject around an AussomNotificationView.
    • @r A new wrapper.
  • setBackgroundColor (object ColorAjo)

    Sets the background fill Color used by the view.

    • @p ColorAjo is an AussomJavaObject around a javafx.scene.paint.Color.
    • @r this object
  • setTextColor (object ColorAjo)

    Sets the text fill Color used by the view.

    • @p ColorAjo is an AussomJavaObject around a javafx.scene.paint.Color.
    • @r this object
  • setAppWidth (int AppWidth)

    Sets the app width used by the view's layout math.

    • @p AppWidth is an int width in pixels.
    • @r this object
  • setAppHeight (int AppHeight)

    Sets the app height used by the view's layout math.

    • @p AppHeight is an int height in pixels.
    • @r this object
  • onPlayInAnimation (callback Cb)

    Registers the playInAnimation callback (fires when the view is added to the scene).

    • @p Cb is a callback () -> void.
    • @r this object
  • onPush (callback Cb)

    Registers the push callback (fires when the next Notification is presented).

    • @p Cb is a callback (notificationAjo) -> void.
    • @r this object
  • onPlayOutAnimation (callback Cb)

    Registers the playOutAnimation callback (fires when the view is removed from the scene).

    • @p Cb is a callback () -> void.
    • @r this object
  • onUpdate (callback Cb)

    Registers the per-frame onUpdate callback.

    • @p Cb is a callback (double tpf) -> void.
    • @r this object
  • getBackgroundColor ()

    Returns the background fill Color AJO.

  • getTextColor ()

    Returns the text fill Color AJO.

  • getAppWidth ()

    Returns the app width in pixels.

  • getAppHeight ()

    Returns the app height in pixels.

  • playInAnimation ()

    Direct trigger for the playInAnimation hook. Invokes the Aussom callback registered via onPlayInAnimation.

  • playOutAnimation ()

    Direct trigger for the playOutAnimation hook.

  • push (object NotificationAjo)

    Direct trigger for the push hook with the supplied Notification AJO.

    • @p NotificationAjo is an AussomJavaObject around a com.almasb.fxgl.notification.Notification.