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

◆ backInOut

detail::backInOutEasing backInOut {}
inlineconstexpr

Easing function combining anticipation at the start and overshoot at the end.

The backInOut easing function creates a dramatic motion curve by pulling back before the start (anticipation), accelerating through the middle, then overshooting past the target before settling (spring-back). This combines the effects of both backIn and backOut for maximum expressiveness.

This easing creates highly dynamic animations suitable for:

  • Attention-grabbing transitions that need maximum visual interest
  • Character animations requiring wind-up and follow-through
  • Scene transitions with dramatic flair
  • Emphasizing both the start and end states of an animation

The dual overshoot (negative at start, positive at end) makes this one of the most expressive easings, but it should be used judiciously as it can feel exaggerated if overused. It works best for focal animations rather than ambient motion.

Note
The animation will have values outside the start-to-target range at both ends. During the first half, values will dip below the start; during the second half, values will exceed the target before settling.
// Create a dramatic page transition
auto position = tweeny::from(-100.0f)
.to(100.0f)
.during(90U)
.build();
// Position will go below -100.0f at start and above 100.0f near end
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::backInOutEasing backInOut
Easing function combining anticipation at the start and overshoot at the end.
Definition easing.h:171
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
backIn For only anticipation without overshoot
backOut For only overshoot without anticipation
elasticInOut For a more extreme oscillating version
Visualize at https://easings.net/#easeInOutBack