|
Tweeny 4.1.0
A Tweening library for modern C++
|
◆ linear
Linear easing function with constant velocity throughout the animation. The linear easing function produces uniform motion with no acceleration or deceleration. The interpolation progresses at a constant rate from start to finish, creating mechanical, predictable movement. Linear easing is characterized by:
This easing is appropriate for:
Linear easing is generally not recommended for most UI animations because:
However, it serves as the foundation for all other easing functions and is essential when mechanical precision is more important than natural motion feel. Mathematically, this implements: f(t) = t where t is normalized progress [0, 1]. // Constant velocity scrolling background
auto scroll = tweeny::from(0.0f)
.to(1000.0f)
.during(600U)
.build();
// Progress indicator that matches time exactly
auto progress = tweeny::from(0)
.to(100)
.during(100U)
.build();
// At frame 50, progress will be exactly 50
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::linearEasing linear Linear easing function with constant velocity throughout the animation. Definition easing.h:956 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
|