Tweeny 3.2.0
A Tweening library for modern C++
Loading...
Searching...
No Matches
tween< T > Class Template Reference

Detailed Description

template<typename T>
class tweeny::tween< T >

Class specialization when a tween has a single value.

This class is preferred automatically by your compiler when your tween has only one value. It exists mainly so that you dont need to use std::get<0> to obtain a single value when using tween::step, tween::seek or any other value returning function. Other than that, you should look at the tweeny::tween documentation.

Except for this little detail, this class methods and behaviours are exactly the same.

#include <tween.h>

Public Member Functions

 tween ()
 
tween< T > & to (T t)
 
template<typename... Fs>
tween< T > & via (Fs... fs)
 
template<typename... Fs>
tween< T > & via (int index, Fs... fs)
 
template<typename... Fs>
tween< T > & via (tweeny::easing::enumerated enumerated, Fs... fs)
 
template<typename... Fs>
tween< T > & via (const std::string &easing, Fs... fs)
 
template<typename... Fs>
tween< T > & via (const char *easing, Fs... fs)
 
template<typename... Ds>
tween< T > & during (Ds... ds)
 
const T & step (int32_t dt, bool suppressCallbacks=false)
 
const T & step (uint32_t dt, bool suppressCallbacks=false)
 
const T & step (float dp, bool suppressCallbacks=false)
 
const T & seek (float p, bool suppressCallbacks=false)
 
const T & seek (int32_t d, bool suppressCallbacks=false)
 
const T & seek (uint32_t d, bool suppressCallbacks=false)
 
tween< T > & onStep (typename detail::tweentraits< T >::callbackType callback)
 
tween< T > & onStep (typename detail::tweentraits< T >::noValuesCallbackType callback)
 
tween< T > & onStep (typename detail::tweentraits< T >::noTweenCallbackType callback)
 
tween< T > & onSeek (typename detail::tweentraits< T >::callbackType callback)
 
tween< T > & onSeek (typename detail::tweentraits< T >::noValuesCallbackType callback)
 
tween< T > & onSeek (typename detail::tweentraits< T >::noTweenCallbackType callback)
 
const T & peek () const
 
peek (float progress) const
 
peek (uint32_t time) const
 
uint32_t duration () const
 
float progress () const
 
tween< T > & forward ()
 
tween< T > & backward ()
 
int direction () const
 
const T & jump (size_t point, bool suppressCallbacks=false)
 
uint16_t point () const
 
 tween ()
 Default constructor for a tween.
 
tween< T, Ts... > & to (T t, Ts... vs)
 Adds a new point in this tweening.
 
tween< T, Ts... > & via (Fs... fs)
 Specifies the easing function for the last added point.
 
tween< T, Ts... > & during (Ds... ds)
 Specifies the easing function for the last added point, accepting an enumeration.
 
const detail::tweentraits< T, Ts... >::valuesType & step (int32_t dt, bool suppressCallbacks=false)
 Steps the animation by the designated delta amount.
 
const detail::tweentraits< T, Ts... >::valuesType & step (uint32_t dt, bool suppressCallbacks=false)
 Steps the animation by the designated delta amount.
 
const detail::tweentraits< T, Ts... >::valuesType & step (float dp, bool suppressCallbacks=false)
 Steps the animation by the designated percentage amount.
 
const detail::tweentraits< T, Ts... >::valuesType & seek (float p, bool suppressCallbacks=false)
 Seeks to a specified point in time based on the currentProgress.
 
const detail::tweentraits< T, Ts... >::valuesType & seek (int32_t d, bool suppressCallbacks=false)
 Seeks to a specified point in time.
 
const detail::tweentraits< T, Ts... >::valuesType & seek (uint32_t d, bool suppressCallbacks=false)
 Seeks to a specified point 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.
 
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.
 
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... >::callbackType callback)
 Adds a callback for that will be called when seeking occurs.
 
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... > & onSeek (typename detail::tweentraits< T, Ts... >::noValuesCallbackType callback)
 Adds a callback for that will be called when seeking occurs, accepting only the tween.
 
uint32_t duration () const
 Returns the total duration of this tween.
 
const detail::tweentraits< T, Ts... >::valuesType & peek () const
 Returns the current tween values.
 
const detail::tweentraits< T, Ts... >::valuesType peek (float progress) const
 Calculates and returns the tween values at a given progress.
 
const detail::tweentraits< T, Ts... >::valuesType peek (uint32_t time) const
 Calculates and return the tween values at a given time.
 
float progress () const
 Returns the current currentProgress of the interpolation.
 
tween< T, Ts... > & forward ()
 Sets the direction of this tween forward.
 
tween< T, Ts... > & backward ()
 Sets the direction of this tween backward.
 
int direction () const
 Returns the current direction of this tween.
 
const detail::tweentraits< T, Ts... >::valuesType & jump (size_t point, bool suppressCallbacks=false)
 Jumps to a specific tween point.
 
uint16_t point () const
 Returns the current tween point.
 

Static Public Member Functions

static tween< T, Ts... > from (T t, Ts... vs)
 Instantiates a tween from a starting point.