Light-weight timer. More...
#include <CCScheduler.h>
Public Member Functions | |
Timer (void) | |
bool | initWithTarget (Object *target, SEL_SCHEDULE selector) |
Initializes a timer with a target and a selector. More... | |
var | initWithTarget ( var target, var selector) |
Initializes a timer with a target and a selector. More... | |
local | initWithTarget ( local target, local selector) |
Initializes a timer with a target and a selector. More... | |
bool | initWithTarget (Object *target, SEL_SCHEDULE selector, float seconds, unsigned int repeat, float delay) |
Initializes a timer with a target, a selector and an interval in seconds, repeat in number of times to repeat, delay in seconds. More... | |
var | initWithTarget ( var target, var selector, var seconds, var repeat, var delay) |
Initializes a timer with a target, a selector and an interval in seconds, repeat in number of times to repeat, delay in seconds. More... | |
local | initWithTarget ( local target, local selector, local seconds, local repeat, local delay) |
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 handler, float seconds) |
Initializes a timer with a script callback function and an interval in seconds. More... | |
float | getInterval () const |
get interval in seconds More... | |
var | getInterval () |
get interval in seconds More... | |
local | getInterval () |
get interval in seconds More... | |
void | setInterval (float interval) |
set interval in seconds More... | |
var | setInterval ( var interval) |
set interval in seconds More... | |
local | setInterval ( local interval) |
set interval in seconds More... | |
SEL_SCHEDULE | getSelector () const |
void | update (float dt) |
triggers the timer More... | |
var | update ( var dt) |
triggers the timer More... | |
local | update ( local dt) |
triggers the timer More... | |
int | getScriptHandler () const |
var | getScriptHandler () |
local | getScriptHandler () |
![]() | |
Object () | |
Constructor. More... | |
virtual | ~Object () |
void | release () |
Release the ownership immediately. More... | |
void | retain () |
Retains the ownership. More... | |
Object * | autorelease () |
Release the ownership sometime soon automatically. More... | |
bool | isSingleReference () const |
Returns a boolean value that indicates whether there is only one reference to the object. More... | |
unsigned int | retainCount () const |
Returns the object's current reference count. More... | |
unsigned int | getReferenceCount () const |
virtual bool | isEqual (const Object *object) |
Returns a boolean value that indicates whether this object and a given object are equal. More... | |
virtual void | acceptVisitor (DataVisitor &visitor) |
Static Public Member Functions | |
static Timer * | create (Object *target, SEL_SCHEDULE selector) |
Allocates a timer with a target and a selector. More... | |
static Timer * | create (Object *target, SEL_SCHEDULE selector, float seconds) |
Allocates a timer with a target, a selector and an interval in seconds. More... | |
static Timer * | createWithScriptHandler (int handler, float seconds) |
Allocates a timer with a script callback function and an interval in seconds. More... | |
static CC_DEPRECATED_ATTRIBUTE Timer * | timerWithTarget (Object *target, SEL_SCHEDULE selector) |
local | timerWithTarget ( local target, local selector) |
static CC_DEPRECATED_ATTRIBUTE Timer * | timerWithTarget (Object *target, SEL_SCHEDULE selector, float seconds) |
local | timerWithTarget ( local target, local selector, local seconds) |
static CC_DEPRECATED_ATTRIBUTE Timer * | timerWithScriptHandler (int handler, float seconds) |
local | timerWithScriptHandler ( local handler, local seconds) |
Protected Attributes | |
Object * | _target |
float | _elapsed |
var | _elapsed |
local | _elapsed |
bool | _runForever |
var | _runForever |
local | _runForever |
bool | _useDelay |
var | _useDelay |
local | _useDelay |
unsigned int | _timesExecuted |
var | _timesExecuted |
local | _timesExecuted |
unsigned int | _repeat |
var | _repeat |
local | _repeat |
float | _delay |
var | _delay |
local | _delay |
float | _interval |
var | _interval |
local | _interval |
SEL_SCHEDULE | _selector |
var | _selector |
local | _selector |
int | _scriptHandler |
var | _scriptHandler |
local | _scriptHandler |
![]() | |
unsigned int | _referenceCount |
count of references More... | |
Additional Inherited Members | |
![]() | |
unsigned int | _ID |
object id, ScriptSupport need public _ID More... | |
int | _luaID |
Lua reference id. More... | |
Light-weight timer.
Timer | ( | void | ) |
var Timer | ( | ) |
local Timer | ( | ) |
|
static |
Allocates a timer with a target and a selector.
|
static |
Allocates a timer with a target and a selector.
|
static |
Allocates a timer with a target and a selector.
|
static |
Allocates a timer with a target, a selector and an interval in seconds.
|
static |
Allocates a timer with a target, a selector and an interval in seconds.
|
static |
Allocates a timer with a target, a selector and an interval in seconds.
|
static |
Allocates a timer with a script callback function and an interval in seconds.
float getInterval | ( | ) | const |
get interval in seconds
var getInterval | ( | ) |
get interval in seconds
local getInterval | ( | ) |
get interval in seconds
|
inline |
|
inline |
|
inline |
SEL_SCHEDULE getSelector | ( | ) | const |
bool initWithScriptHandler | ( | int | handler, |
float | seconds | ||
) |
Initializes a timer with a script callback function and an interval in seconds.
var initWithScriptHandler | ( | var | handler, |
var | seconds | ||
) |
Initializes a timer with a script callback function and an interval in seconds.
local initWithScriptHandler | ( | local | handler, |
local | seconds | ||
) |
Initializes a timer with a script callback function and an interval in seconds.
bool initWithTarget | ( | Object * | target, |
SEL_SCHEDULE | selector | ||
) |
Initializes a timer with a target and a selector.
var initWithTarget | ( | var | target, |
var | selector | ||
) |
Initializes a timer with a target and a selector.
local initWithTarget | ( | local | target, |
local | selector | ||
) |
Initializes a timer with a target and a selector.
bool initWithTarget | ( | Object * | target, |
SEL_SCHEDULE | selector, | ||
float | seconds, | ||
unsigned int | repeat, | ||
float | delay | ||
) |
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 | target, |
var | selector, | ||
var | seconds, | ||
var | repeat, | ||
var | delay | ||
) |
Initializes a timer with a target, a selector and an interval in seconds, repeat in number of times to repeat, delay in seconds.
local initWithTarget | ( | local | target, |
local | selector, | ||
local | seconds, | ||
local | repeat, | ||
local | delay | ||
) |
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 | interval) |
set interval in seconds
var setInterval | ( | var | interval) |
set interval in seconds
local setInterval | ( | local | interval) |
set interval in seconds
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
virtual |
triggers the timer
Reimplemented from Object.
|
virtual |
triggers the timer
Reimplemented from Object.
|
virtual |
triggers the timer
Reimplemented from Object.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |