Hasty Badger
Small UI library (a branch of Turbo Badger)
 All Classes Namespaces Functions Variables Enumerations Enumerator Friends Groups Pages
tb::TBAnimationObject Class Referenceabstract

TBAnimationObject - Base class for all animated object. More...

#include <tb_animation.h>

Inheritance diagram for tb::TBAnimationObject:
tb::TBTypedObject tb::TBLinkOf< TBAnimationObject > tb::TBLink tb::TBAnimatedFloat tb::TBWidgetAnimationObject tb::TBFloatAnimator tb::TBWidgetAnimationOpacity tb::TBWidgetAnimationRect

Public Member Functions

 TBOBJECT_SUBCLASS (TBAnimationObject, TBTypedObject)
 
bool IsAnimating () const
 Return true if the object is currently animating. More...
 
virtual void OnAnimationStart ()=0
 Called on animation start.
 
virtual void OnAnimationUpdate (float progress)=0
 Called on animation update. More...
 
virtual void OnAnimationStop (bool aborted)=0
 Called on animation stop. More...
 
void AddListener (TBAnimationListener *listener)
 Add a listener to this animation object. More...
 
void RemoveListener (TBAnimationListener *listener)
 Remove a listener from this animation object. More...
 
- Public Member Functions inherited from tb::TBTypedObject
virtual bool IsOfTypeId (const TB_TYPE_ID type_id) const
 Returns true if the class or the base class matches the type id.
 
template<class T >
T * SafeCastTo () const
 Returns this object as the given type or nullptr if it's not that type. More...
 
template<class T >
bool IsOfType () const
 Return true if this object can safely be casted to the given type. More...
 
virtual const char * GetClassName () const
 Get the classname of the object. More...
 

Public Attributes

ANIMATION_CURVE animation_curve
 
double animation_start_time
 
double animation_duration
 
bool adjust_start_time
 

Friends

class TBAnimationManager
 

Additional Inherited Members

- Static Public Member Functions inherited from tb::TBTypedObject
template<class T >
static TB_TYPE_ID GetTypeId ()
 A static template method that returns a unique id for each type. More...
 

Detailed Description

TBAnimationObject - Base class for all animated object.

Member Function Documentation

void tb::TBAnimationObject::AddListener ( TBAnimationListener listener)
inline

Add a listener to this animation object.

bool tb::TBAnimationObject::IsAnimating ( ) const
inline

Return true if the object is currently animating.

virtual void tb::TBAnimationObject::OnAnimationStop ( bool  aborted)
pure virtual

Called on animation stop.

aborted is true if it was aborted before completion. Note that if a animation is started when it's already running, it will first be aborted and then started again.

Implemented in tb::TBWidgetAnimationRect, tb::TBWidgetAnimationOpacity, and tb::TBAnimatedFloat.

virtual void tb::TBAnimationObject::OnAnimationUpdate ( float  progress)
pure virtual

Called on animation update.

progress is current progress from 0 to 1. Note that it isn't called on start, so progress 0 might not happen. It will be called with progress 1 before the animation is completed normally (not aborted)

Implemented in tb::TBWidgetAnimationRect, tb::TBFloatAnimator, tb::TBWidgetAnimationOpacity, and tb::TBAnimatedFloat.

void tb::TBAnimationObject::RemoveListener ( TBAnimationListener listener)
inline

Remove a listener from this animation object.


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