EasingStyle - CoolPotato31F/Java-Graphics GitHub Wiki
EasingStyle Enum
The EasingStyle enum defines different easing functions that can be used for animations. Easing functions help create smooth transitions by adjusting the rate of change over time, making animations feel more natural and visually appealing.
Enum Definition
package graphics;
public enum EasingStyle {
LINEAR,
SINE,
QUAD,
CUBIC,
QUART,
QUINT,
EXPONENTIAL,
CIRCULAR,
BACK,
ELASTIC,
BOUNCE
}
Easing Functions Overview
Below is a breakdown of each easing style and how it affects animation speed:
1. LINEAR
- Moves at a constant speed.
- No acceleration or deceleration.
- Example use case: Simple progress bars.
2. SINE
- Starts and ends smoothly, following a sine wave curve.
- Example use case: Subtle UI animations.
3. QUAD (Quadratic)
- Accelerates or decelerates at a moderate rate.
- Example use case: Smooth fade-ins and fade-outs.
4. CUBIC
- Faster acceleration and deceleration compared to QUAD.
- Example use case: Button click effects.
5. QUART (Quartic)
- Stronger easing than CUBIC, with a more pronounced curve.
- Example use case: Quick but smooth transitions.
6. QUINT (Quintic)
- Even steeper acceleration and deceleration.
- Example use case: Dynamic animations with a strong emphasis on speed changes.
7. EXPONENTIAL
- Starts very slow but rapidly increases in speed.
- Example use case: Dramatic zoom-in effects.
8. CIRCULAR
- Mimics circular motion for a more organic feel.
- Example use case: Rotational animations.
9. BACK
- Moves slightly in the opposite direction before progressing forward.
- Example use case: Spring-like effects, pop-up animations.
10. ELASTIC
- Bounces as it reaches its destination, like a rubber band.
- Example use case: Playful UI elements.
11. BOUNCE
- Simulates a bouncing effect when reaching the endpoint.
- Example use case: Ball drop animations or physics-based effects.