-
Notifications
You must be signed in to change notification settings - Fork 1
Easing
Shmellyorc edited this page Aug 31, 2026
·
2 revisions
Easing functions control the rate of change of a value over time, producing different acceleration and deceleration patterns for animations, transitions, and other time-based effects.
The easing library provides 33 different easing functions covering 11 families with four direction variants each: In, Out, InOut, and OutIn.
| Family | Description |
|---|---|
| Linear | No easing, constant speed |
| Quadratic | Smooth acceleration and deceleration |
| Cubic | More pronounced acceleration and deceleration |
| Quartic | Strong acceleration and deceleration |
| Quintic | Very strong acceleration and deceleration |
| Sine | Smooth sinusoidal curves |
| Exponential | Extremely fast acceleration or deceleration |
| Circular | Circular arc motion |
| Back | Overshoots the target before settling |
| Elastic | Oscillates like a spring |
| Bounce | Bounces at the end or start |
| Variant | Description |
|---|---|
| In | Starts slow, ends fast |
| Out | Starts fast, ends slow |
| InOut | Starts slow, accelerates, then decelerates at the end |
| OutIn | Starts fast, decelerates, then accelerates again |
// Evaluate an easing function at a normalized time (0 to 1)
float t = 0.5f;
float eased = Easing.Ease(EaseType.QuadOut, t);
// Use the eased value for interpolation
float value = MathHelper.Lerp(0f, 100f, eased);| Type | Description |
|---|---|
Linear |
No easing, constant speed |
| Type | Description |
|---|---|
QuadIn |
Starts slow, accelerates toward the end |
QuadOut |
Starts fast, decelerates toward the end |
QuadInOut |
Starts slow, accelerates, then decelerates |
QuadOutIn |
Starts fast, decelerates, then accelerates |
| Type | Description |
|---|---|
CubicIn |
Starts very slow, accelerates toward the end |
CubicOut |
Starts fast, decelerates toward the end |
CubicInOut |
Starts slow, accelerates, then decelerates |
CubicOutIn |
Starts fast, decelerates, then accelerates |
| Type | Description |
|---|---|
QuartIn |
Starts very slow, accelerates strongly |
QuartOut |
Starts very fast, decelerates strongly |
QuartInOut |
Starts slow, accelerates strongly, then decelerates |
QuartOutIn |
Starts fast, decelerates strongly, then accelerates |
| Type | Description |
|---|---|
QuintIn |
Starts extremely slow, accelerates sharply |
QuintOut |
Starts extremely fast, decelerates sharply |
QuintInOut |
Starts slow, accelerates sharply, then decelerates |
QuintOutIn |
Starts fast, decelerates sharply, then accelerates |
| Type | Description |
|---|---|
SineIn |
Starts slowly with a smooth sinusoidal curve |
SineOut |
Ends slowly with a smooth sinusoidal curve |
SineInOut |
Starts and ends slowly with a smooth curve |
SineOutIn |
Slow middle section with sinusoidal smoothing |
| Type | Description |
|---|---|
ExpoIn |
Starts imperceptibly slow, accelerates extremely fast |
ExpoOut |
Starts extremely fast, decelerates imperceptibly |
ExpoInOut |
Starts imperceptibly slow, accelerates, then decelerates |
ExpoOutIn |
Starts fast, decelerates, then accelerates imperceptibly |
| Type | Description |
|---|---|
CircIn |
Follows a circular arc starting slowly |
CircOut |
Follows a circular arc ending slowly |
CircInOut |
Follows a circular arc starting and ending slowly |
CircOutIn |
Follows a circular arc with a slow middle |
| Type | Description |
|---|---|
BackIn |
Overshoots the starting point before moving forward |
BackOut |
Overshoots the ending point before settling |
BackInOut |
Overshoots both the start and end points |
BackOutIn |
Overshoots in the middle of the transition |
| Type | Description |
|---|---|
ElasticIn |
Oscillates with a spring-like effect at the start |
ElasticOut |
Oscillates with a spring-like effect at the end |
ElasticInOut |
Oscillates with a spring-like effect at both ends |
ElasticOutIn |
Oscillates with a spring-like effect in the middle |
| Type | Description |
|---|---|
BounceIn |
Bounces at the start of the transition |
BounceOut |
Bounces at the end of the transition |
BounceInOut |
Bounces at both the start and end |
BounceOutIn |
Bounces in the middle of the transition |
// Animate a value using easing
float duration = 1f;
float elapsed = 0f;
float startValue = 0f;
float endValue = 100f;
while (elapsed < duration)
{
float t = elapsed / duration;
float eased = Easing.Ease(EaseType.QuadOut, t);
float currentValue = MathHelper.Lerp(startValue, endValue, eased);
elapsed += frameTime.DeltaTime;
}| Feature | Description |
|---|---|
| 33 easing functions | 11 families × 4 directions |
| Normalized input | Values between 0 and 1 |
| Normalized output | Values between 0 and 1 |
| All families | Quadratic, Cubic, Quartic, Quintic, Sine, Exponential, Circular, Back, Elastic, Bounce |
- MathHelper
- FileHelper
- HashHelper
- JsonHelper
- MapHelper
- TextHelper
- SoundHelper
- AlignHelpers
- Instance Helper
- Enum Extensions
- String Extensions
- Int Extensions
- Float Extensions
- IEnumerable Extensions
- Random Extensions
- Sound Extensions
- Font Extensions