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

◆ bounceOut

detail::bounceOutEasing bounceOut {}
inlineconstexpr

Bounce easing simulating a ball dropping and bouncing to rest.

The bounceOut easing function creates the classic ball-drop effect where an object bounces several times with decreasing height before coming to rest. This mimics real-world physics of an inelastic collision and is one of the most recognizable easing patterns.

Characteristics:

  • Multiple discrete bounces with decreasing amplitude
  • Simulates impact and energy loss
  • Creates playful, physical motion
  • Widely recognized and understood by users

This easing excels at:

  • Object drops: Items falling into place
  • Landing animations: Characters, UI elements touching down
  • Playful interactions: Buttons, icons, notifications
  • Game elements: Collectibles, power-ups, score displays
  • Error/success feedback: Visual confirmation with personality
  • Cartoon physics: Exaggerated, entertaining motion

BounceOut is more popular than elasticOut when you want discrete impacts rather than smooth oscillation. It conveys weight and physicality better than spring-based easings.

The bouncing creates natural emphasis on the final position, making it excellent for drawing attention to where something lands.

// Notification dropping in from above
auto y = tweeny::from(-100.0f)
.to(0.0f)
.during(45U)
.build();
// Button that bounces into place
auto scale = tweeny::from(0.0f)
.to(1.0f)
.during(40U)
.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::bounceOutEasing bounceOut
Bounce easing simulating a ball dropping and bouncing to rest.
Definition easing.h:259
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 inverse bouncing at the start
bounceInOut For bouncing at both ends
elasticOut For smooth spring-like alternative
Visualize at https://easings.net/#easeOutBounce