Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: VirtualInput

[19:7] extends: FxObj

Wraps FXGL's VirtualInput abstract base (com.almasb.fxgl.input.virtual.VirtualInput), the abstract supertype of VirtualController / VirtualDpad / VirtualJoystick / VirtualMenuKey. Carries the bound Input, the shared createView pipeline, and the pressVirtual / releaseVirtual helpers used to synthesize button events from on-screen taps. Adopt-only — concrete instances come from VirtualController, VirtualDpad, etc. wrappers.

Methods

  • VirtualInput ()

    Empty default constructor; populated by adopt.

  • adopt (object Ajo)

    Wraps an existing VirtualInput AussomJavaObject.

    • @p Ajo is an AussomJavaObject around a VirtualInput subclass.
  • createView ()

    Returns the assembled view Group AJO containing every virtual-button view.

  • createViewForButton (object ButtonAjo)

    Returns the view Node AJO for a single VirtualButton.

    • @p ButtonAjo is a VirtualButton AJO (use VirtualButton.A() etc).
  • pressVirtual (string ButtonName)

    Synthesizes a press event for the supplied VirtualButton.

    • @p ButtonName is the constant name ("LEFT", "A", "LB", etc.).
  • releaseVirtual (string ButtonName)

    Synthesizes a release event for the supplied VirtualButton.