Class cc.Timer
Extends
cc.Class.
Defined in: CCScheduler.js.
Constructor Attributes | Constructor Name and Description |
---|---|
cc.Timer()
Light weight timer
|
Method Attributes | Method Name and Description |
---|---|
ctor()
cc.Timer's Constructor
Constructor
|
|
returns interval of timer
|
|
initWithTarget(target, selector, seconds, repeat, delay)
Initializes a timer with a target, a selector and an interval in seconds.
|
|
<static> |
cc.Timer.timerWithTarget(target, selector, seconds)
Allocates a timer with a target, a selector and an interval in seconds.
|
update(dt)
triggers the timer
|
Method Detail
ctor()
cc.Timer's Constructor
Constructor
{Number}
getInterval()
returns interval of timer
- Returns:
- {Number}
{Boolean}
initWithTarget(target, selector, seconds, repeat, delay)
Initializes a timer with a target, a selector and an interval in seconds.
- Parameters:
- {cc.Class} target
- target
- {String|function} selector
- Selector
- {Number} seconds
- second
- repeat
- delay
- Returns:
- {Boolean} true if inintialized *
<static>
{cc.Timer}
cc.Timer.timerWithTarget(target, selector, seconds)
Allocates a timer with a target, a selector and an interval in seconds.
- Parameters:
- {cc.Class} target
- {String|function} selector
- Selector
- {Number} seconds
- Returns:
- {cc.Timer} a cc.Timer instance
update(dt)
triggers the timer
- Parameters:
- {Number} dt
- delta time