Package totalcross.ui.anim
Class EasingCurves
- java.lang.Object
-
- totalcross.ui.anim.EasingCurves
-
public final class EasingCurves extends java.lang.ObjectThis class provides static functions for the most common easing curves used around the world and on most design guides, such as Google's Material Design [1] In curves are used to approach a value at maximum speed Out curves are used to approach a value at zero speed InOut curves mixes the in and out curves, creating a S-shaped curve Elastic curves extrapolate both begin and end values a little for a visually pleasant effect Bounce curves arrive at the end value multiple times before settling in, creating a bouncy effect. Illustrations of these curves can be seen at [2] For a reference implementation, see [3] All easing curves take 4 parameters: the begin and end values, the animation duration and the position we want to evaluate on the curve References: [1] https://material.io/guidelines/motion/duration-easing.html [2] http://easings.net [3] https://github.com/daimajia/AnimationEasingFunctions
-
-
Constructor Summary
Constructors Constructor Description EasingCurves()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static doubleInOutQuadratic(double begin, double end, double duration, double t)Quadratic InOut Curve.static doubleInQuadratic(double begin, double end, double duration, double t)Quadratic In Curve.static doubleOutQuadratic(double begin, double end, double duration, double t)Quadratic Out Curve.
-
-
-
Method Detail
-
InQuadratic
public static double InQuadratic(double begin, double end, double duration, double t)Quadratic In Curve.- Parameters:
begin- starting valueend- ending valueduration- durationt- current time (0 <= t < duration)- Returns:
-
OutQuadratic
public static double OutQuadratic(double begin, double end, double duration, double t)Quadratic Out Curve.- Parameters:
begin- starting valueend- ending valueduration- durationt- current time (0 <= t < duration)- Returns:
-
InOutQuadratic
public static double InOutQuadratic(double begin, double end, double duration, double t)Quadratic InOut Curve.- Parameters:
begin- starting valueend- ending valueduration- durationt- current time (0 <= t < duration)- Returns:
-
-