Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: AnimatedValue

[19:7] extends: FxObj

Wraps FXGL's AnimatedValue (com.almasb.fxgl.animation.AnimatedValue), the base generic type for "animate any value from A to B" interpolation. The generic form animates via JavaFX's Interpolator.interpolate; for typed forms see the AnimatedPoint2D, AnimatedPoint3D, AnimatedColor, AnimatedPath, AnimatedString*, AnimatedImage, and AnimatedQuad/CubicBezierPoint2D subclasses. Pair with AnimationBuilder.animate(animatedValue) for use in the animation pipeline.

Methods

  • AnimatedValue (From = null, To = null)

    Creates a new AnimatedValue for arbitrary T values that Interpolator.interpolate can handle (typically doubles).

    • @p From is the starting value.
    • @p To is the ending value.
  • adopt (object Ajo)

    Wraps an existing AnimatedValue AussomJavaObject.

    • @p Ajo is an AussomJavaObject around an AnimatedValue.
    • @r A new wrapper.
  • getFrom ()

    Returns the starting value.

  • getTo ()

    Returns the ending value.

  • getValue (double Progress)

    Samples the animated value at Progress in [0, 1] using the default linear interpolator.

    • @p Progress is the progress fraction.
    • @r The interpolated value.
  • getValueInterp (double Progress, InterpolatorObj)

    Samples the animated value at Progress with the supplied Interpolator.

    • @p Progress is the progress fraction.
    • @p InterpolatorObj is an AussomJavaObject around an Interpolator (see fxgl.Interpolators).
    • @r The interpolated value.