|
Tweeny 4.1.0
A Tweening library for modern C++
|
◆ elasticInOut
Elastic easing combining spring oscillation at both start and end. The elasticInOut easing function creates dramatic elastic motion with oscillation during both the initial acceleration and final deceleration phases. The animation winds up with spring-like vibration, accelerates smoothly through the middle, then oscillates around the target before settling. The motion profile:
This easing is appropriate for:
ElasticInOut is the most expressive elastic variant but also the most extreme. It works best for animations that are:
Use sparingly; the dual oscillation can feel excessive for everyday interactions. Consider elasticOut or backInOut for a more balanced alternative.
// Dramatic screen transition
auto position = tweeny::from(0.0f)
.to(1920.0f)
.during(90U)
.build();
// Position will oscillate around 0.0f at start and 1920.0f at end
// Game title appearing with maximum impact
auto scale = tweeny::from(0.0f)
.to(2.0f)
.during(75U)
.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::elasticInOutEasing elasticInOut Elastic easing combining spring oscillation at both start and end. Definition easing.h:738 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
|