Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: AnimationBuilder

[22:7] extends: FxObj

Wraps FXGL's AnimationBuilder, the fluent factory used to assemble an Animation. Builders chain duration, delay, interpolator, repeat, autoReverse, and onFinished, then a terminator (build, buildAndPlay) realizes the Animation. The translate / fade / scale / rotate methods on the Java builder produce specialized subbuilders; this wrapper exposes the common terminal path plus the typical scene-level tuning.

Methods

  • AnimationBuilder ()

    Creates a new AnimationBuilder with default settings.

  • adopt (object Ajo)

    Wraps an existing AnimationBuilder, for example one returned by fxgl.animationBuilder bound to a specific scene.

    • @p Ajo is an AussomJavaObject around an AnimationBuilder.
    • @r A new wrapper.
  • duration (double Seconds)

    Sets the animation duration.

    • @p Seconds is a double with the total animation time.
    • @r this object
  • interpolator (InterpolatorObj)

    Sets the interpolator (easing curve) used by the animation. Pass an AussomJavaObject around a JavaFX Interpolator, typically obtained from fxgl.Interpolators (e.g. Interpolators.easeOut("EXPONENTIAL")).

    • @p InterpolatorObj is an AussomJavaObject around an Interpolator.
    • @r this object
  • delay (double Seconds)

    Sets a delay before the animation starts.

    • @p Seconds is a double with the delay.
    • @r this object
  • repeat (int Times)

    Sets the number of repeat cycles.

    • @p Times is an int with the repeat count.
    • @r this object
  • repeatInfinitely ()

    Sets the animation to repeat indefinitely.

    • @r this object
  • autoReverse (bool Reverse)

    Sets whether the animation reverses on alternating cycles.

    • @p Reverse is a bool.
    • @r this object
  • onFinished (callback Cb)

    Registers a callback that runs when the animation finishes.

    • @p Cb is a callback with no arguments.
    • @r this object
  • onCycleFinished (callback Cb)

    Registers a callback that runs at the end of each cycle.

    • @p Cb is a callback with no arguments.
    • @r this object
  • translate (list Entities)

    Begins a translation animation for the listed entities or nodes. Returns a TranslationAnimationBuilder that takes from / to / alongPath / build / buildAndPlay.

    • @p Entities is a list of Entity wrappers (or fx.Node wrappers) -- each entry should pass the wrapper's .obj so the underlying Java object is forwarded.
    • @r A TranslationAnimationBuilder wrapper.
  • fade (list Entities)

    Begins a fade (opacity) animation for the listed entities or nodes. Returns a FadeAnimationBuilder.

    • @p Entities is a list of .obj references.
    • @r A FadeAnimationBuilder wrapper.
  • fadeIn (list Entities)

    Begins a fade-in animation pre-configured from 0.0 to 1.0. FXGL's native fadeIn only accepts vararg, so this wrapper uses fade(...) and pre-sets the 0.0 -> 1.0 endpoints.

    • @p Entities is a list of .obj references.
    • @r A FadeAnimationBuilder wrapper.
  • fadeOut (list Entities)

    Begins a fade-out animation pre-configured from 1.0 to 0.0. Uses fade(...) and pre-sets the 1.0 -> 0.0 endpoints since FXGL's native fadeOut only accepts vararg.

    • @p Entities is a list of .obj references.
    • @r A FadeAnimationBuilder wrapper.
  • scale (list Entities)

    Begins a scale animation for the listed entities or nodes. Returns a ScaleAnimationBuilder.

    • @p Entities is a list of .obj references.
    • @r A ScaleAnimationBuilder wrapper.
  • rotate (list Entities)

    Begins a rotation animation for the listed entities or nodes. Returns a RotationAnimationBuilder.

    • @p Entities is a list of .obj references.
    • @r A RotationAnimationBuilder wrapper.
  • animate (object PropertyObj)

    Begins a generic animation on any JavaFX WritableValue (DoubleProperty, IntegerProperty, StringProperty, ObjectProperty). Returns a PropertyAnimationBuilder that takes from / to / build / buildAndPlay.

    • @p PropertyObj is an AussomJavaObject around a WritableValue.
    • @r A PropertyAnimationBuilder wrapper.
  • buildSequence (list Anims)

    Builds a sequence Animation that plays the listed Animations end-to-end. Each entry must be an Animation wrapper (typically produced by build() on a subbuilder).

    • @p Anims is a list of Animation wrappers -- each entry should pass the wrapper's .obj reference.
    • @r An Animation wrapper around the composed sequence.
  • bobbleDown (object NodeObj)

    Plays a small bobble (vertical drop + return) on a single Node. Pre-configures duration 0.15 with autoReverse and 2 repeats. Returns a TranslationAnimationBuilder configured with the bobble's from / to.

    • @p NodeObj is a fx.Node wrapper (or any AussomJavaObject around a JavaFX Node).
    • @r A TranslationAnimationBuilder wrapper.
  • getDuration ()

    Returns the duration Duration AJO.

  • setDuration (object DurationAjo)

    Sets the duration from a Duration AJO.

  • getDelay ()

    Returns the delay Duration AJO.

  • setDelay (object DurationAjo)

    Sets the delay from a Duration AJO.

  • getInterpolator ()

    Returns the Interpolator AJO.

  • setInterpolator (object InterpolatorAjo)

    Sets the Interpolator AJO directly.

  • getTimes ()

    Returns the repeat count.

  • setTimes (int N)

    Sets the repeat count.

  • isAutoReverse ()

    Returns true when auto-reverse is enabled.

  • setAutoReverse (bool V)

    Sets the auto-reverse flag.

  • getOnFinished ()

    Returns the on-finished Runnable AJO.

  • setOnFinished (object RunnableAjo)

    Sets the on-finished callback directly. Accepts a Runnable AJO.

  • getOnCycleFinished ()

    Returns the on-cycle-finished Runnable AJO.

  • setOnCycleFinished (object RunnableAjo)

    Sets the on-cycle-finished callback directly.