#include <Tween.h>
Classes | |
class | Options |
Public Types | |
typedef std::function< T(const T &, const T &, float)> | LerpFn |
typedef std::function< void()> | StartFn |
typedef std::function< void()> | FinishFn |
typedef std::function< void()> | UpdateFn |
Public Member Functions | |
Tween (T *target, T endValue, float startTime, float duration, EaseFn easeFunction=easeNone, LerpFn lerpFunction=&tweenLerp< T >) | |
Tween (T *target, T startValue, T endValue, float startTime, float duration, EaseFn easeFunction=easeNone, LerpFn lerpFunction=&tweenLerp< T >) | |
virtual | ~Tween () |
T | getStartValue () const |
Returns the starting value for the tween. If the tween will copy its target's value upon starting (isCopyStartValue()) and the tween has not started, this returns the value of its target when the tween was created. More... | |
T | getEndValue () const |
T * | getTarget () const |
bool | isCopyStartValue () |
Returns whether the tween will copy its target's value upon starting. More... | |
void | setLerpFn (const LerpFn &lerpFn) |
TweenRef< T > | getThisRef () |
Returns a TweenRef<T> to this. More... | |
void | setEaseFn (EaseFn easeFunction) |
change how the tween moves through time More... | |
EaseFn | getEaseFn () const |
void | setStartFn (StartFn startFunction) |
StartFn | getStartFn () const |
void | setReverseStartFn (StartFn reverseStartFunction) |
StartFn | getReverseStartFn () const |
void | setUpdateFn (UpdateFn updateFunction) |
UpdateFn | getUpdateFn () const |
void | setFinishFn (FinishFn finishFn) |
FinishFn | getFinishFn () const |
void | setReverseFinishFn (FinishFn reverseFinishFn) |
FinishFn | getReverseFinishFn () const |
float | getStartTime () const |
Returns the item's start time. More... | |
void | setStartTime (float newTime) |
Set the items's start time to newTime. More... | |
float | getDuration () const |
Returns the item's duration. More... | |
void | setDuration (float newDuration) |
Sets the item's duration to newDuration. More... | |
bool | getLoop () const |
Returns whether the item starts over when it is complete. More... | |
void | setLoop (bool doLoop=true) |
Sets whether the item starts over when it is complete. More... | |
bool | getPingPong () const |
Returns whether the item alternates between forward and reverse. Overrides loop when true. More... | |
void | setPingPong (bool pingPong=true) |
Sets whether the item alternates between forward and reverse. Overrides loop when true. More... | |
bool | getInfinite () const |
Returns whether the item ever is marked as complete. More... | |
void | setInfinite (bool infinite=true) |
Sets whether the item ever is marked as complete. More... | |
float | getEndTime () const |
Returns the time of the item's competion, equivalent to getStartTime() + getDuration(). More... | |
class Timeline * | getParent () const |
Returns a pointer to the item's parent Timeline. More... | |
void | removeSelf () |
Removes the item from its parent Timeline. More... | |
bool | hasStarted () const |
Returns whether the item has started. More... | |
bool | isComplete () |
Returns whether the item has completed. More... | |
bool | getAutoRemove () const |
Should the item remove itself from the Timeline when it is complete. More... | |
void | setAutoRemove (bool autoRemove=true) |
Sets whether the item will remove itself from the Timeline when it is complete. More... | |
virtual void | loopStart () |
virtual bool | updateAtLoopStart () |
Call update() only at the beginning of each loop (for example Cues exhibit require this behavior) More... | |
virtual float | calcDuration () const |
void | stepTo (float time, bool reverse) |
go to a specific time, generally called by the parent Timeline only. If reverse then playhead is interpreted as retreating rather than advancing. More... | |
TimelineItemRef | thisRef () |
Protected Member Functions | |
virtual void | reverse () |
virtual TimelineItemRef | clone () const |
Creates a clone of the item. More... | |
virtual TimelineItemRef | cloneReverse () const |
Creates a cloned item which runs in reverse relative to a timeline of duration timelineDuration. More... | |
virtual void | start (bool reverse) |
virtual void | update (float relativeTime) |
virtual void | reset (bool unsetStarted) |
Marks the item as not completed, and if unsetStarted, marks the item as not started. More... | |
virtual void | complete (bool reverse) |
void | setDurationDirty () |
void | updateDuration () const |
float | loopTime (float absTime) |
Converts time from absolute to absolute based on item's looping attributes. More... | |
void | setTarget (void *target) |
Protected Attributes | |
T | mStartValue |
T | mEndValue |
LerpFn | mLerpFunction |
StartFn | mStartFunction |
StartFn | mReverseStartFunction |
UpdateFn | mUpdateFunction |
FinishFn | mFinishFunction |
FinishFn | mReverseFinishFunction |
EaseFn | mEaseFunction |
float | mDuration |
bool | mCopyStartValue |
class Timeline * | mParent |
void * | mTarget |
float | mStartTime |
bool | mHasStarted |
bool | mHasReverseStarted |
bool | mComplete |
bool | mReverseComplete |
bool | mMarkedForRemoval |
bool | mInfinite |
bool | mLoop |
bool | mPingPong |
bool | mUseAbsoluteTime |
bool | mAutoRemove |
int32_t | mLastLoopIteration |
typedef std::function<T (const T&, const T&, float)> cinder::Tween< T >::LerpFn |
|
inherited |
|
inherited |
|
inherited |
cinder::Tween< T >::Tween | ( | T * | target, |
T | endValue, | ||
float | startTime, | ||
float | duration, | ||
EaseFn | easeFunction = easeNone , |
||
LerpFn | lerpFunction = &tweenLerp<T> |
||
) |
cinder::Tween< T >::Tween | ( | T * | target, |
T | startValue, | ||
T | endValue, | ||
float | startTime, | ||
float | duration, | ||
EaseFn | easeFunction = easeNone , |
||
LerpFn | lerpFunction = &tweenLerp<T> |
||
) |
|
virtual |
T cinder::Tween< T >::getStartValue | ( | ) | const |
Returns the starting value for the tween. If the tween will copy its target's value upon starting (isCopyStartValue()) and the tween has not started, this returns the value of its target when the tween was created.
T cinder::Tween< T >::getEndValue | ( | ) | const |
T* cinder::Tween< T >::getTarget | ( | ) | const |
bool cinder::Tween< T >::isCopyStartValue | ( | ) |
Returns whether the tween will copy its target's value upon starting.
void cinder::Tween< T >::setLerpFn | ( | const LerpFn & | lerpFn | ) |
TweenRef<T> cinder::Tween< T >::getThisRef | ( | ) |
Returns a TweenRef<T> to this.
|
protectedvirtual |
Implements cinder::TimelineItem.
|
protectedvirtual |
Creates a clone of the item.
Implements cinder::TimelineItem.
|
protectedvirtual |
Creates a cloned item which runs in reverse relative to a timeline of duration timelineDuration.
Implements cinder::TimelineItem.
|
protectedvirtual |
Implements cinder::TimelineItem.
|
protectedvirtual |
Implements cinder::TimelineItem.
Reimplemented in cinder::FnTween< T >.
change how the tween moves through time
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
protectedvirtualinherited |
Marks the item as not completed, and if unsetStarted, marks the item as not started.
Reimplemented from cinder::TimelineItem.
|
protectedvirtualinherited |
Implements cinder::TimelineItem.
|
inherited |
Returns the item's start time.
|
inherited |
Set the items's start time to newTime.
|
inherited |
Returns the item's duration.
|
inherited |
Sets the item's duration to newDuration.
|
inherited |
Returns whether the item starts over when it is complete.
|
inherited |
Sets whether the item starts over when it is complete.
|
inherited |
Returns whether the item alternates between forward and reverse. Overrides loop when true.
|
inherited |
Sets whether the item alternates between forward and reverse. Overrides loop when true.
|
inherited |
Returns whether the item ever is marked as complete.
|
inherited |
Sets whether the item ever is marked as complete.
|
inherited |
Returns the time of the item's competion, equivalent to getStartTime() + getDuration().
|
inherited |
Returns a pointer to the item's parent Timeline.
|
inherited |
Returns whether the item has started.
|
inherited |
Returns whether the item has completed.
|
inherited |
Should the item remove itself from the Timeline when it is complete.
|
inherited |
Sets whether the item will remove itself from the Timeline when it is complete.
|
virtualinherited |
Reimplemented in cinder::Cue, and cinder::Timeline.
|
virtualinherited |
Call update() only at the beginning of each loop (for example Cues exhibit require this behavior)
Reimplemented in cinder::Cue.
|
virtualinherited |
Reimplemented in cinder::Timeline.
|
inherited |
go to a specific time, generally called by the parent Timeline only. If reverse then playhead is interpreted as retreating rather than advancing.
|
inherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
Converts time from absolute to absolute based on item's looping attributes.
|
protected |
|
protected |
|
protected |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |