37#include "tweentraits.h"
38#include "tweenpoint.h"
47 template<
typename T,
typename... Ts>
109 template<
typename... Fs>
tween<T, Ts...> &
via(Fs... fs);
123 template<
typename... Fs>
tween<T, Ts...> &
via(
int index, Fs... fs);
164 const typename detail::tweentraits<T, Ts...>::valuesType &
step(int32_t dt,
bool suppressCallbacks =
false);
176 const typename detail::tweentraits<T, Ts...>::valuesType &
step(uint32_t dt,
bool suppressCallbacks =
false);
197 const typename detail::tweentraits<T, Ts...>::valuesType &
step(
float dp,
bool suppressCallbacks =
false);
208 const typename detail::tweentraits<T, Ts...>::valuesType &
seek(
float p,
bool suppressCallbacks =
false);
220 const typename detail::tweentraits<T, Ts...>::valuesType &
seek(int32_t d,
bool suppressCallbacks =
false);
232 const typename detail::tweentraits<T, Ts...>::valuesType &
seek(uint32_t d,
bool suppressCallbacks =
false);
265 tween<T, Ts...> &
onStep(
typename detail::tweentraits<T, Ts...>::callbackType callback);
297 tween<T, Ts...> &
onStep(
typename detail::tweentraits<T, Ts...>::noValuesCallbackType callback);
329 tween<T, Ts...> &
onStep(
typename detail::tweentraits<T, Ts...>::noTweenCallbackType callback);
358 tween<T, Ts...> &
onSeek(
typename detail::tweentraits<T, Ts...>::callbackType callback);
387 tween<T, Ts...> &
onSeek(
typename detail::tweentraits<T, Ts...>::noTweenCallbackType callback);
416 tween<T, Ts...> &
onSeek(
typename detail::tweentraits<T, Ts...>::noValuesCallbackType callback);
432 const typename detail::tweentraits<T, Ts...>::valuesType &
peek()
const;
441 const typename detail::tweentraits<T, Ts...>::valuesType
peek(
float progress)
const;
451 const typename detail::tweentraits<T, Ts...>::valuesType
peek(uint32_t time)
const;
496 const typename detail::tweentraits<T, Ts...>::valuesType &
jump(int32_t
point,
bool suppressCallbacks =
false);
506 using traits = detail::tweentraits<T, Ts...>;
510 uint16_t currentPoint = 0;
511 float currentProgress = 0;
512 std::vector<detail::tweenpoint<T, Ts...>> points;
513 typename traits::valuesType current;
514 std::vector<typename traits::callbackType> onStepCallbacks;
515 std::vector<typename traits::callbackType> onSeekCallbacks;
516 int8_t currentDirection = 1;
520 tween(T t, Ts... vs);
521 template<
size_t I>
void interpolate(
float prog,
unsigned point,
typename traits::valuesType & values, detail::int2type<I>)
const;
522 void interpolate(
float prog,
unsigned point,
typename traits::valuesType & values, detail::int2type<0>)
const;
523 void render(
float p);
524 void dispatch(std::vector<typename traits::callbackType> & cbVector);
525 uint16_t pointAt(
float progress)
const;
549 const T &
step(int32_t dt,
bool suppressCallbacks =
false);
550 const T &
step(uint32_t dt,
bool suppressCallbacks =
false);
551 const T &
step(
float dp,
bool suppressCallbacks =
false);
552 const T &
seek(
float p,
bool suppressCallbacks =
false);
553 const T &
seek(int32_t d,
bool suppressCallbacks =
false);
554 const T &
seek(uint32_t d,
bool suppressCallbacks =
false);
556 tween<T> &
onStep(
typename detail::tweentraits<T>::noValuesCallbackType callback);
557 tween<T> &
onStep(
typename detail::tweentraits<T>::noTweenCallbackType callback);
559 tween<T> &
onSeek(
typename detail::tweentraits<T>::noValuesCallbackType callback);
560 tween<T> &
onSeek(
typename detail::tweentraits<T>::noTweenCallbackType callback);
569 const T &
jump(int32_t
point,
bool suppressCallbacks =
false);
573 using traits = detail::tweentraits<T>;
577 uint16_t currentPoint = 0;
578 float currentProgress = 0;
579 std::vector<detail::tweenpoint<T>> points;
581 std::vector<typename traits::callbackType> onStepCallbacks;
582 std::vector<typename traits::callbackType> onSeekCallbacks;
583 int8_t currentDirection = 1;
588 void interpolate(
float prog,
unsigned point, T & value)
const;
589 void render(
float p);
590 void dispatch(std::vector<typename traits::callbackType> & cbVector);
591 uint16_t pointAt(
float progress)
const;
596#include "tweenone.tcc"
tween< T > & onStep(typename detail::tweentraits< T >::noValuesCallbackType callback)
const T & jump(int32_t point, bool suppressCallbacks=false)
tween< T > & via(int index, Fs... fs)
tween< T > & during(Ds... ds)
const T & seek(int32_t d, bool suppressCallbacks=false)
T peek(float progress) const
tween< T > & onStep(typename detail::tweentraits< T >::callbackType callback)
T peek(uint32_t time) const
tween< T > & onSeek(typename detail::tweentraits< T >::callbackType callback)
const T & step(uint32_t dt, bool suppressCallbacks=false)
tween< T > & onStep(typename detail::tweentraits< T >::noTweenCallbackType callback)
const T & seek(uint32_t d, bool suppressCallbacks=false)
tween< T > & via(Fs... fs)
tween< T > & onSeek(typename detail::tweentraits< T >::noValuesCallbackType callback)
uint32_t duration() const
const T & seek(float p, bool suppressCallbacks=false)
const T & step(int32_t dt, bool suppressCallbacks=false)
const T & step(float dp, bool suppressCallbacks=false)
tween< T > & onSeek(typename detail::tweentraits< T >::noTweenCallbackType callback)
const detail::tweentraits< T, Ts... >::valuesType & step(uint32_t dt, bool suppressCallbacks=false)
Steps the animation by the designated delta amount.
int direction() const
Returns the current direction of this tween.
const detail::tweentraits< T, Ts... >::valuesType & seek(int32_t d, bool suppressCallbacks=false)
Seeks to a specified currentPoint in time.
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.
const detail::tweentraits< T, Ts... >::valuesType & seek(uint32_t d, bool suppressCallbacks=false)
Seeks to a specified currentPoint in time.
const detail::tweentraits< T, Ts... >::valuesType & step(float dp, bool suppressCallbacks=false)
Steps the animation by the designated percentage amount.
uint16_t point() const
Returns the current tween point.
const detail::tweentraits< T, Ts... >::valuesType & seek(float p, bool suppressCallbacks=false)
Seeks to a specified currentPoint in time based on the currentProgress.
tween< T, Ts... > & to(T t, Ts... vs)
Adds a new currentPoint in this tweening.
tween< T, Ts... > & via(int index, Fs... fs)
Specifies the easing function for a specific currentPoint.
const detail::tweentraits< T, Ts... >::valuesType peek(uint32_t time) const
Calculates and return the tween values at a given time.
tween()
Default constructor for a tween.
static tween< T, Ts... > from(T t, Ts... vs)
Instantiates a tween from a starting currentPoint.
tween< T, Ts... > & onSeek(typename detail::tweentraits< T, Ts... >::callbackType callback)
Adds a callback for that will be called when seeking occurs.
tween< T, Ts... > & during(Ds... ds)
Specifies the duration, typically in milliseconds, for the tweening of values in last currentPoint.
tween< T, Ts... > & backward()
Sets the direction of this tween backward.
const detail::tweentraits< T, Ts... >::valuesType & peek() const
Returns the current tween values.
tween< T, Ts... > & onSeek(typename detail::tweentraits< T, Ts... >::noTweenCallbackType callback)
Adds a callback for that will be called when seeking occurs, accepting only the tween values.
tween< T, Ts... > & onStep(typename detail::tweentraits< T, Ts... >::noValuesCallbackType callback)
Adds a callback that will be called when stepping occurs, accepting only the tween.
const detail::tweentraits< T, Ts... >::valuesType peek(float progress) const
Calculates and returns the tween values at a given progress.
uint32_t duration() const
Returns the total duration of this tween.
tween< T, Ts... > & forward()
Sets the direction of this tween forward.
tween< T, Ts... > & via(Fs... fs)
Specifies the easing function for the last added currentPoint.
tween< T, Ts... > & onStep(typename detail::tweentraits< T, Ts... >::noTweenCallbackType callback)
Adds a callback that will be called when stepping occurs, accepting only the tween values.
tween< T, Ts... > & onSeek(typename detail::tweentraits< T, Ts... >::noValuesCallbackType callback)
Adds a callback for that will be called when seeking occurs, accepting only the tween.
const detail::tweentraits< T, Ts... >::valuesType & jump(int32_t point, bool suppressCallbacks=false)
Jumps to a specific tween currentPoint.
const detail::tweentraits< T, Ts... >::valuesType & step(int32_t dt, bool suppressCallbacks=false)
Steps the animation by the designated delta amount.
float progress() const
Returns the current currentProgress of the interpolation.
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