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

◆ bounceIn

detail::bounceInEasing bounceIn {}
inlineconstexpr

Bounce easing simulating a ball bouncing with increasing height at the start.

The bounceIn easing function creates a bouncing effect before the animation begins, like a ball dropped from above that bounces progressively higher before launching into the main motion. This is the reverse of bounceOut's natural physics.

Characteristics:

  • Multiple discrete "bounces" at the start
  • Each bounce is higher than the previous
  • Creates anticipation through impact-based motion
  • Less commonly used than bounceOut

This easing works well for:

  • Landing preparation: Elements about to drop into place
  • Impact anticipation: Building up to a collision
  • Reverse playback effects: Bounced animations played backward
  • Stylized entrances: Cartoon-style wind-up effects

BounceIn is less intuitive than bounceOut because it reverses natural physics (balls don't normally bounce higher each time). Consider backIn for more natural anticipation.

// Element that bounces before sliding in
auto position = tweeny::from(0.0f)
.to(200.0f)
.during(50U)
.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::bounceInEasing bounceIn
Bounce easing simulating a ball bouncing with increasing height at the start.
Definition easing.h:209
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
bounceOut For natural ball-drop bouncing at the end
bounceInOut For bouncing at both start and end
backIn For simpler anticipation without discrete impacts
Visualize at https://easings.net/#easeInBounce