Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: LiftComponent

[19:7] extends: Component

Wraps FXGL's LiftComponent (com.almasb.fxgl.dsl.components.LiftComponent), which moves the entity back and forth on either axis at the configured distance / duration / speed. Use one of the xAxis* / yAxis* configurators to enable motion on that axis; the entity oscillates between two endpoints, swapping direction every duration period.

Methods

  • LiftComponent (TimerAjo = null, bool SkipCtor = false)

    Creates a new LiftComponent. The optional LocalTimer arg is used to drive the oscillation clock; when omitted the underlying Kotlin ctor calls FXGL.getGameTimer().newLocalTimer() which requires a running FXGL engine. Pass a LocalTimer AJO directly for engine-free construction (tests, ad-hoc tools).

    • @p TimerAjo is an optional AJO around a com.almasb.fxgl.time.LocalTimer.
  • adopt (object Ajo)

    Wraps an existing LiftComponent AussomJavaObject.

  • isGoingRight ()

    Returns true if the X-axis motion is currently positive.

  • setGoingRight (bool V)

  • isGoingUp ()

    Returns true if the Y-axis motion is currently negative (up).

  • setGoingUp (bool V)

  • xAxisDistanceDuration (double Distance, double DurationSeconds)

    Enables X-axis lift from a distance and a half-cycle duration. Speed is derived as distance/duration.

    • @p Distance is the peak-to-peak distance in pixels.
    • @p DurationSeconds is the half-cycle duration in seconds.
    • @r this object
  • xAxisSpeedDuration (double Speed, double DurationSeconds)

    Enables X-axis lift from a speed and a half-cycle duration. Distance is derived as speed*duration.

    • @p Speed is the pixels-per-second speed.
    • @p DurationSeconds is the half-cycle duration in seconds.
    • @r this object
  • xAxisSpeedDistance (double Speed, double Distance)

    Enables X-axis lift from a speed and a distance. Duration is derived as distance/speed.

    • @p Speed is the pixels-per-second speed.
    • @p Distance is the peak-to-peak distance in pixels.
    • @r this object
  • yAxisDistanceDuration (double Distance, double DurationSeconds)

    Y-axis form of xAxisDistanceDuration.

  • yAxisSpeedDuration (double Speed, double DurationSeconds)

    Y-axis form of xAxisSpeedDuration.

  • yAxisSpeedDistance (double Speed, double Distance)

    Y-axis form of xAxisSpeedDistance.