cocos2d-x  2.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
CCTimer Class Reference

Light-weight timer. More...

#include <CCScheduler.h>

Inheritance diagram for CCTimer:
CCObject CCCopying

Public Member Functions

 CCTimer (void)
 ctor ()
float getInterval (void) const
 get interval in seconds More...
 
void setInterval (float fInterval)
 set interval in seconds More...
 
SEL_SCHEDULE getSelector () const
bool initWithTarget (CCObject *pTarget, SEL_SCHEDULE pfnSelector)
 Initializes a timer with a target and a selector. More...
 
var initWithTarget ( var pTarget, var pfnSelector)
 Initializes a timer with a target and a selector. More...
 
bool initWithTarget (CCObject *pTarget, SEL_SCHEDULE pfnSelector, float fSeconds, unsigned int nRepeat, float fDelay)
 Initializes a timer with a target, a selector and an interval in seconds, repeat in number of times to repeat, delay in seconds. More...
 
bool initWithScriptHandler (int nHandler, float fSeconds)
 Initializes a timer with a script callback function and an interval in seconds. More...
 
void update (float dt)
 triggers the timer More...
 
int getScriptHandler ()
var getScriptHandler ()
- Public Member Functions inherited from CCObject
 CCObject (void)
virtual ~CCObject (void)
void release (void)
void retain (void)
CCObjectautorelease (void)
CCObjectcopy (void)
bool isSingleReference (void) const
unsigned int retainCount (void) const
virtual bool isEqual (const CCObject *pObject)
virtual void acceptVisitor (CCDataVisitor &visitor)
- Public Member Functions inherited from CCCopying
virtual CCObjectcopyWithZone (CCZone *pZone)

Static Public Member Functions

static CCTimertimerWithTarget (CCObject *pTarget, SEL_SCHEDULE pfnSelector)
 Allocates a timer with a target and a selector. More...
 
var timerWithTarget ( var pTarget, var pfnSelector)
 Allocates a timer with a target and a selector. More...
 
static CCTimertimerWithTarget (CCObject *pTarget, SEL_SCHEDULE pfnSelector, float fSeconds)
 Allocates a timer with a target, a selector and an interval in seconds. More...
 
static CCTimertimerWithScriptHandler (int nHandler, float fSeconds)
 Allocates a timer with a script callback function and an interval in seconds. More...
 
local timerWithScriptHandler ( local nHandler, local fSeconds)
 Allocates a timer with a script callback function and an interval in seconds. More...
 

Protected Attributes

CCObjectm_pTarget
float m_fElapsed
var m_fElapsed
local m_fElapsed
bool m_bRunForever
var m_bRunForever
local m_bRunForever
bool m_bUseDelay
var m_bUseDelay
local m_bUseDelay
unsigned int m_uTimesExecuted
var m_uTimesExecuted
local m_uTimesExecuted
unsigned int m_uRepeat
var m_uRepeat
local m_uRepeat
float m_fDelay
var m_fDelay
local m_fDelay
float m_fInterval
var m_fInterval
local m_fInterval
SEL_SCHEDULE m_pfnSelector
var m_pfnSelector
local m_pfnSelector
int m_nScriptHandler
var m_nScriptHandler
local m_nScriptHandler
- Protected Attributes inherited from CCObject
unsigned int m_uReference
unsigned int m_uAutoReleaseCount

Additional Inherited Members

- Public Attributes inherited from CCObject
unsigned int m_uID
int m_nLuaID

Detailed Description

Light-weight timer.

Constructor & Destructor Documentation

CCTimer ( void  )
var ctor (   )

Member Function Documentation

float getInterval ( void  ) const

get interval in seconds

var getInterval (   )

get interval in seconds

local getInterval (   )

get interval in seconds

int getScriptHandler ( )
inline
var getScriptHandler ( )
inline
SEL_SCHEDULE getSelector ( ) const
var getSelector ( )
bool initWithScriptHandler ( int  nHandler,
float  fSeconds 
)

Initializes a timer with a script callback function and an interval in seconds.

var initWithScriptHandler ( var  nHandler,
var  fSeconds 
)

Initializes a timer with a script callback function and an interval in seconds.

local initWithScriptHandler ( local  nHandler,
local  fSeconds 
)

Initializes a timer with a script callback function and an interval in seconds.

bool initWithTarget ( CCObject pTarget,
SEL_SCHEDULE  pfnSelector 
)

Initializes a timer with a target and a selector.

var initWithTarget ( var  pTarget,
var  pfnSelector 
)

Initializes a timer with a target and a selector.

bool initWithTarget ( CCObject pTarget,
SEL_SCHEDULE  pfnSelector,
float  fSeconds,
unsigned int  nRepeat,
float  fDelay 
)

Initializes a timer with a target, a selector and an interval in seconds, repeat in number of times to repeat, delay in seconds.

var initWithTarget ( var  pTarget,
var  pfnSelector,
var  fSeconds,
var  nRepeat,
var  fDelay 
)

Initializes a timer with a target, a selector and an interval in seconds, repeat in number of times to repeat, delay in seconds.

void setInterval ( float  fInterval)

set interval in seconds

var setInterval ( var  fInterval)

set interval in seconds

local setInterval ( local  fInterval)

set interval in seconds

static CCTimer*
timerWithScriptHandler
( int  nHandler,
float  fSeconds 
)
static

Allocates a timer with a script callback function and an interval in seconds.

var timerWithScriptHandler ( var  nHandler,
var  fSeconds 
)
static

Allocates a timer with a script callback function and an interval in seconds.

local timerWithScriptHandler ( local  nHandler,
local  fSeconds 
)
static

Allocates a timer with a script callback function and an interval in seconds.

static CCTimer* timerWithTarget ( CCObject pTarget,
SEL_SCHEDULE  pfnSelector 
)
static

Allocates a timer with a target and a selector.

var timerWithTarget ( var  pTarget,
var  pfnSelector 
)
static

Allocates a timer with a target and a selector.

static CCTimer* timerWithTarget ( CCObject pTarget,
SEL_SCHEDULE  pfnSelector,
float  fSeconds 
)
static

Allocates a timer with a target, a selector and an interval in seconds.

var timerWithTarget ( var  pTarget,
var  pfnSelector,
var  fSeconds 
)
static

Allocates a timer with a target, a selector and an interval in seconds.

void update ( float  dt)
virtual

triggers the timer

Reimplemented from CCObject.

var update ( var  dt)
virtual

triggers the timer

Reimplemented from CCObject.

local update ( local  dt)
virtual

triggers the timer

Reimplemented from CCObject.

Member Data Documentation

bool m_bRunForever
protected
var m_bRunForever
protected
local m_bRunForever
protected
bool m_bUseDelay
protected
var m_bUseDelay
protected
local m_bUseDelay
protected
float m_fDelay
protected
var m_fDelay
protected
local m_fDelay
protected
float m_fElapsed
protected
var m_fElapsed
protected
local m_fElapsed
protected
float m_fInterval
protected
var m_fInterval
protected
local m_fInterval
protected
int m_nScriptHandler
protected
var m_nScriptHandler
protected
local m_nScriptHandler
protected
SEL_SCHEDULE m_pfnSelector
protected
var m_pfnSelector
protected
local m_pfnSelector
protected
CCObject* m_pTarget
protected
var m_pTarget
protected
local m_pTarget
protected
unsigned int m_uRepeat
protected
var m_uRepeat
protected
local m_uRepeat
protected
unsigned int m_uTimesExecuted
protected
var m_uTimesExecuted
protected
local m_uTimesExecuted
protected

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