Interface Easing

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface Easing
An easing curve: maps linear progress t in [0, 1] to eased progress, 0 at 0 and 1 at 1. Some curves overshoot (BACK_OUT, ELASTIC_OUT) and leave [0, 1] in between.

Curves follow the usual names (easings.net): IN starts slow, OUT ends slow.

  • Field Details

    • LINEAR

      static final Easing LINEAR
      No easing.
    • QUAD_IN

      static final Easing QUAD_IN
      Quadratic, slow start.
    • QUAD_OUT

      static final Easing QUAD_OUT
      Quadratic, slow end; the classic decelerate.
    • QUAD_IN_OUT

      static final Easing QUAD_IN_OUT
      Quadratic, slow start and end.
    • CUBIC_IN

      static final Easing CUBIC_IN
      Cubic, slow start.
    • CUBIC_OUT

      static final Easing CUBIC_OUT
      Cubic, slow end.
    • CUBIC_IN_OUT

      static final Easing CUBIC_IN_OUT
      Cubic, slow start and end.
    • QUINT_OUT

      static final Easing QUINT_OUT
      Quintic, slow end; a long soft landing.
    • SINE_OUT

      static final Easing SINE_OUT
      Sine, slow end.
    • SINE_IN_OUT

      static final Easing SINE_IN_OUT
      Sine, slow start and end.
    • EXPO_OUT

      static final Easing EXPO_OUT
      Exponential, slow end.
    • CIRC_OUT

      static final Easing CIRC_OUT
      Circular, slow end.
    • SMOOTHSTEP

      static final Easing SMOOTHSTEP
      Hermite smoothstep.
    • BACK_OUT

      static final Easing BACK_OUT
      Overshoots past 1 and settles back.
    • ELASTIC_OUT

      static final Easing ELASTIC_OUT
      A springy overshoot that oscillates into place.
    • BOUNCE_OUT

      static final Easing BOUNCE_OUT
      Bounces at the end like a dropped ball.
  • Method Details

    • apply

      double apply(double t)
      Eases a progress value.
      Parameters:
      t - linear progress, [0, 1]
      Returns:
      eased progress
    • back

      static Easing back(double overshoot)
      An overshooting ease-out.
      Parameters:
      overshoot - how far past 1 it swings; 1.70158 is the common default
      Returns:
      the curve
    • reversed

      default Easing reversed()
      Plays this curve backwards in time: 1 - f(1 - t), turning an ease-out into the matching ease-in.
      Returns:
      the reversed curve