Tweeny
3.2.0
A Tweening library for modern C++
|
◆ onStep() [3/3]
Adds a callback that will be called when stepping occurs, accepting only the tween. You can add as many callbacks as you want. It must receive the tween as an argument. Callbacks can be of any callable type. It will only be called via tween::step() functions. For seek callbacks, see tween::onSeek(). Keep in mind that the function will be copied into an array, so any variable captured by value will also be copied with it. If the callback returns false, it will be called next time. If it returns true, it will be removed from the callback queue. Example: // pass a lambda
// pass a functor instance
struct ftor { void operator()(tweeny::tween<int> & t) { printf("%d ", t.values()); return false; } };
t.onStep(ftor());
tween< T, Ts... > & onStep(typename detail::tweentraits< T, Ts... >::callbackType callback) Adds a callback that will be called when stepping occurs, accepting both the tween and its values. static tween< T, Ts... > from(T t, Ts... vs) Instantiates a tween from a starting point. The tween class is the core class of tweeny. It controls the interpolation steps, easings and duratio... Definition: tween.h:48 The tweeny namespace contains all symbols and names for the Tweeny library. Definition: MANUAL.dox:1
|