Tweeny 4.1.0
A Tweening library for modern C++
Loading...
Searching...
No Matches

◆ bounceInOut

detail::bounceInOutEasing bounceInOut {}
inlineconstexpr

Bounce easing with bouncing at both start and end.

The bounceInOut easing function combines reverse bouncing at the start with natural bouncing at the end. The motion bounces with increasing height initially, accelerates through the middle, then bounces to rest at the target.

Motion profile:

  • First half: Bounces with increasing amplitude (bounceIn)
  • Midpoint: Smooth transition
  • Second half: Bounces with decreasing amplitude (bounceOut)
  • Creates playful, impact-based motion at both ends

This easing is appropriate for:

  • Playful transitions: Fun, energetic scene changes
  • Game UI: High-energy, cartoon-style interfaces
  • Children's applications: Whimsical, entertaining motion
  • Attention-grabbing effects: Elements that need maximum personality

BounceInOut is quite dramatic and can feel excessive for business applications, productivity tools, and enterprise software where subtlety is preferred. The dual bouncing works best in contexts where playfulness is a design goal.

// Playful modal transition
auto scale = tweeny::from(0.0f)
.to(1.0f)
.during(60U)
.build();
tweeny_builder< true, FirstValue, RemainingValues... > to(const FirstValue &firstComponent, const RemainingValues &... remainingComponents) &
Adds a target keyframe to the tween.
Definition tweeny.h:109
tweeny_builder & via(EasingFunctionTypes... easing_functions)
Specifies per-component easing functions for the last keyframe segment.
Definition tweeny.h:198
constexpr detail::bounceInOutEasing bounceInOut
Bounce easing with bouncing at both start and end.
Definition easing.h:298
tweeny_builder< false, FirstValue, RemainingValues... > from(FirstValue firstComponent, RemainingValues... remainingComponents)
Creates a new tween builder starting from the specified value(s).
Definition tweeny.h:347
See also
bounceIn For bouncing only at the start
bounceOut For bouncing only at the end (more commonly useful)
elasticInOut For spring-like alternative
Visualize at https://easings.net/#easeInOutBounce