cocos2d-x  3.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Timer Class Referenceabstract

Light-weight timer. More...

#include <CCScheduler.h>

Inheritance diagram for Timer:
Ref TimerTargetCallback TimerTargetSelector

Public Member Functions

float getInterval () const
 get interval in seconds More...
 
void setInterval (float interval)
 set interval in seconds More...
 
void setupTimerWithInterval (float seconds, unsigned int repeat, float delay)
 
virtual void trigger ()=0
 
virtual void cancel ()=0
 
void update (float dt)
 triggers the timer More...
 
- Public Member Functions inherited from Ref
void retain ()
 Retains the ownership. More...
 
void release ()
 Releases the ownership immediately. More...
 
Refautorelease ()
 Releases the ownership sometime soon automatically. More...
 
unsigned int getReferenceCount () const
 Returns the Ref's current reference count. More...
 
virtual ~Ref ()
 NA NA More...
 

Protected Member Functions

 Timer ()
 
- Protected Member Functions inherited from Ref
 Ref ()
 Constructor. More...
 

Protected Attributes

Scheduler_scheduler
 
float _elapsed
 
bool _runForever
 
bool _useDelay
 
unsigned int _timesExecuted
 
unsigned int _repeat
 
float _delay
 
float _interval
 
- Protected Attributes inherited from Ref
unsigned int _referenceCount
 count of references More...
 

Detailed Description

Light-weight timer.

Constructor & Destructor Documentation

Timer ( )
protected

Member Function Documentation

virtual void cancel ( )
pure virtual
float getInterval ( ) const
inline

get interval in seconds

void setInterval ( float  interval)
inline

set interval in seconds

void setupTimerWithInterval ( float  seconds,
unsigned int  repeat,
float  delay 
)
virtual void trigger ( )
pure virtual
void update ( float  dt)

triggers the timer

Member Data Documentation

float _delay
protected
float _elapsed
protected
float _interval
protected
unsigned int _repeat
protected
bool _runForever
protected
Scheduler* _scheduler
protected
unsigned int _timesExecuted
protected
bool _useDelay
protected

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