Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: ObservableTrigger

[17:7] extends: FxObj

Wraps FXGL's ObservableTrigger (com.almasb.fxgl.input.ObservableTrigger), the holder returned by Input.triggerProperty(action). Carries the live Trigger (the current key / mouse binding) plus a name property and re-fires isTriggered / isReleased queries against an event. Construct with a Trigger AJO; commonly obtained from Input via the wrapper rather than built directly.

Methods

  • ObservableTrigger (object TriggerAjo = null)

    Creates a new ObservableTrigger around an initial Trigger AJO.

    • @p TriggerAjo is a com.almasb.fxgl.input.Trigger AJO (e.g. a KeyTrigger or MouseTrigger).
  • adopt (object Ajo)

    Wraps an existing ObservableTrigger AussomJavaObject.

  • getTrigger ()

    Returns the ReadOnlyObjectWrapper AJO. Bind to it to react when the user rebinds the action.

  • getName ()

    Returns the ReadOnlyStringWrapper for the trigger's display name (e.g. "Space", "Ctrl+S").

  • isTriggered (object EventAjo)

    Returns true if the supplied InputEvent matches the current trigger's pressed condition.

    • @p EventAjo is a javafx.scene.input.InputEvent AJO.
  • isReleased (object EventAjo)

    Returns true if the supplied InputEvent matches the current trigger's released condition.