Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: InputCapture

[18:7] extends: TriggerListener

Wraps FXGL's InputCapture (com.almasb.fxgl.input.InputCapture), the recorder/replayer for user input. Obtain instances from Input.startCapture (which returns one as the capture is recorded) and feed back into Input.applyCapture to replay. InputCapture is also serializable through Bundle, so captures can be written to disk for demos, replays, or AI training data.

Methods

  • InputCapture ()

    Creates a new empty InputCapture. Most users obtain one from Input.startCapture instead.

  • adopt (object Ajo)

    Wraps an existing InputCapture AussomJavaObject.

    • @p Ajo is an AussomJavaObject around an InputCapture.
    • @r A new wrapper.
  • update (double Tpf)

    Manually drives the capture's internal time clock. Normally Input.startCapture drives this automatically; useful when running captures outside the engine loop (tests).

    • @p Tpf is the elapsed time in seconds.
    • @r this object
  • write (object BundleObj)

    Serializes this capture into the given Bundle.

    • @p BundleObj is a Bundle wrapper.
    • @r this object
  • read (object BundleObj)

    Restores this capture's data from the given Bundle.

    • @p BundleObj is a Bundle wrapper previously written into.
    • @r this object