|
Tweeny 4.1.0
A Tweening library for modern C++
|
◆ elasticIn
Elastic easing with oscillating spring-like motion at the start. The elasticIn easing function creates a spring or elastic band effect that oscillates with increasing amplitude before reaching the starting point of the animation. The motion resembles pulling back an elastic band that vibrates as tension builds. The oscillation characteristics:
This easing is particularly effective for:
The elastic effect is more dramatic than back easing, making it suitable for contexts where strong visual emphasis or entertainment value is desired. It's less appropriate for subtle or professional interfaces. Mathematically, this uses a decaying sine wave with exponential amplitude growth.
// Magical charging effect before an action
auto glow = tweeny::from(0.0f)
.to(1.0f)
.during(45U)
.build();
// The glow will oscillate negative before reaching 1.0f
// producing a "charging" visual effect
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::elasticInEasing elasticIn Elastic easing with oscillating spring-like motion at the start. Definition easing.h:618 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
|