Oxygine  1
2g game engine
Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
oxygine::Tween Class Reference
Inheritance diagram for oxygine::Tween:
oxygine::EventDispatcher oxygine::intrusive_list_item< spTween > oxygine::Object oxygine::ref_counter oxygine::ObjectBase oxygine::PoolObject oxygine::TweenQueue oxygine::TweenT< GS >

Public Types

enum  EASE {
  ease_unknown, ease_linear, ease_inQuad, ease_outQuad,
  ease_inOutQuad, ease_outInQuad, ease_inCubic, ease_outCubic,
  ease_inOutCubic, ease_outInCubic, ease_inQuart, ease_outQuart,
  ease_inOutQuart, ease_outInQuart, ease_inQuint, ease_outQuint,
  ease_inOutQuint, ease_outInQuint, ease_inSin, ease_outSin,
  ease_inOutSin, ease_outInSin, ease_inExpo, ease_outExpo,
  ease_inOutExpo, ease_outInExpo, ease_inCirc, ease_outCirc,
  ease_inOutCirc, ease_outInCirc, ease_inBack, ease_outBack,
  ease_inOutBack, ease_outInBack, ease_inBounce, ease_outBounce,
  ease_inOutBounce, ease_outInBounce, ease_count
typedef float(* easeHandler) (EASE ease, float v)
- Public Types inherited from oxygine::ObjectBase
typedef std::vector< ObjectBase * > __createdObjects

Public Member Functions

void init (timeMS duration, int loops=1, bool twoSides=false, timeMS delay=0, EASE ease=Tween::ease_linear)
void init2 (const TweenOptions &opt)
void reset ()
int getLoops () const
timeMS getDuration () const
timeMS getElapsed () const
EASE getEase () const
EASE getGlobalEase () const
timeMS getDelay () const
ActorgetClient () const
float getPercent () const
spObject getDataObject () const
spTween getNextSibling ()
spTween getPrevSibling ()
const EventCallback & getDoneCallback () const
bool isStarted () const
bool isDone () const
void setDataObject (spObject data)
void addDoneCallback (const EventCallback &cb)
void setEase (EASE ease)
void setGlobalEase (EASE ease)
void setDelay (timeMS delay)
void setLoops (int loops)
void setDuration (timeMS duration)
void setClient (Actor *client)
void setTwoSides (bool ts)
void detachWhenDone (bool detach=true)
virtual void complete (timeMS deltaTime=TWEEN_COMPLETE_DT)
void remove ()
void start (Actor &actor)
void update (Actor &actor, const UpdateState &us)
void setDoneCallback (const EventCallback &cb)
- Public Member Functions inherited from oxygine::EventDispatcher
 EventDispatcher (const EventDispatcher &ed)
int addEventListener (eventType, const EventCallback &)
void removeEventListener (eventType, const EventCallback &)
void removeEventListener (int id)
bool hasEventListeners (void *CallbackThis)
bool hasEventListeners (eventType, const EventCallback &)
void removeEventListeners (void *CallbackThis)
void removeAllEventListeners ()
virtual void dispatchEvent (Event *event)
int getListenersCount () const
int getLastListenerID () const
const EventCallback & getListenerByIndex (int index) const
- Public Member Functions inherited from oxygine::Object
 Object (const Object &src)
 Object (bool assignUniqueID=true)
- Public Member Functions inherited from oxygine::ref_counter
void addRef ()
void releaseRef ()
- Public Member Functions inherited from oxygine::ObjectBase
 ObjectBase (const ObjectBase &src)
 ObjectBase (bool assignID=true)
const std::string & getName () const
const void * getUserData () const
int getObjectID () const
bool isName (const std::string &name) const
bool isName (const char *name) const
void setName (const std::string &name)
void setUserData (const void *data)
void dumpObject () const
void __removeFromDebugList ()
- Public Member Functions inherited from oxygine::intrusive_list_item< spTween >
intrusive_list< spTween > * getParentList ()

Static Public Member Functions

static float calcEase (EASE ease, float v)
static void setCustomEaseHandler (easeHandler)
- Static Public Member Functions inherited from oxygine::ObjectBase
static void dumpCreatedObjects ()
static void showAssertInCtor (int id)
static void showAssertInDtor (int id)
static __createdObjects & __getCreatedObjects ()
static void __startTracingLeaks ()
static void __stopTracingLeaks ()

Protected Types

enum  status {
  status_not_started, status_delayed, status_started, status_done,
- Protected Types inherited from oxygine::EventDispatcher
typedef std::vector< listenerlisteners

Protected Member Functions

void done (Actor &, const UpdateState &us)
virtual void _start (Actor &actor)
virtual void _update (Actor &actor, const UpdateState &us)
virtual void _done (Actor &actor, const UpdateState &us)
virtual void _loopDone (Actor &actor, const UpdateState &us)
virtual float _calcEase (float v)
- Protected Member Functions inherited from oxygine::Object
void __doCheck ()
- Protected Member Functions inherited from oxygine::ObjectBase
void __generateID ()
std::string * __getName () const
void __freeName () const
- Protected Member Functions inherited from oxygine::intrusive_list_item< spTween >
spTween & getNextSibling ()
spTween & getPrevSibling ()

Protected Attributes

status _status
timeMS _elapsed
timeMS _duration
timeMS _delay
int _loops
int _loopsDone
EASE _ease
EASE _globalEase
bool _twoSides
float _percent
bool _detach
EventCallback _cbDone
spObject _data
- Protected Attributes inherited from oxygine::EventDispatcher
int _lastID
listeners * _listeners
- Protected Attributes inherited from oxygine::ObjectBase
std::string __name
int __id
const void * __userData
- Protected Attributes inherited from oxygine::intrusive_list_item< spTween >
spTween _prev
spTween _next
intrusive_list< spTween > * _list

Additional Inherited Members

- Public Attributes inherited from oxygine::ref_counter
int _ref_counter
- Static Protected Member Functions inherited from oxygine::ObjectBase
static void __addToDebugList (ObjectBase *base)
static void __removeFromDebugList (ObjectBase *base)
- Static Protected Attributes inherited from oxygine::ObjectBase
static int _lastID
static int _assertCtorID
static int _assertDtorID

Member Function Documentation

◆ addDoneCallback()

void oxygine::Tween::addDoneCallback ( const EventCallback &  cb)

add callback would be called when tween done. Could be added more than one. setDoneCallback is faster because it doesn't allocate memory for list internally

◆ complete()

virtual void oxygine::Tween::complete ( timeMS  deltaTime = TWEEN_COMPLETE_DT)

immediately completes tween, calls doneCallback and mark tween as completed and removes self from Actor. If tween has infinity loops (=-1) then do nothing

Reimplemented in oxygine::TweenQueue.

◆ detachWhenDone()

void oxygine::Tween::detachWhenDone ( bool  detach = true)

delete actor from parent node when tween done

◆ remove()

void oxygine::Tween::remove ( )

removes self from Actor, complete callback not called

◆ reset()

void oxygine::Tween::reset ( )

if you reset internal Tween state it could be reused and added to actor again

◆ setDataObject()

void oxygine::Tween::setDataObject ( spObject  data)

set custom user data object to Tween. Could be used for store some useful data

◆ setDelay()

void oxygine::Tween::setDelay ( timeMS  delay)

set Delay before starting tween

◆ setDoneCallback()

void oxygine::Tween::setDoneCallback ( const EventCallback &  cb)

set callback when tween done. Doesn't allocate memory. faster than addDoneCallback

◆ setEase()

void oxygine::Tween::setEase ( EASE  ease)

set Easing function

◆ setGlobalEase()

void oxygine::Tween::setGlobalEase ( EASE  ease)

set Global Easing function

◆ setLoops()

void oxygine::Tween::setLoops ( int  loops)

loops = -1 means infinity repeat cycles

The documentation for this class was generated from the following file: