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