Tweeny  3
A Tweening library for modern C++

◆ via() [1/2]

tween<T, Ts...>& via ( Fs...  fs)

Specifies the easing function for the last added currentPoint.

This will specify the easing between the last tween currentPoint added by to and its previous step. You can use any callable object. Additionally, you can use the easing objects specified in the class easing.

If it is a multi-value currentPoint, you can either specify a single easing function that will be used for every value or you can specify an easing function for each value. You can mix and match callable objects, lambdas and bundled easing objects.

Example:

// use bundled linear easing
auto tween1 = tweeny::from(0).to(100).via(tweeny::easing::linear);
// use custom lambda easing
auto tween2 = tweeny::from(0).to(100).via([](float p, int a, int b) { return (b-a) * p + a; });
Parameters
fsThe functions
Returns
*this
See also
tweeny::easing