cocos2d-iphone  2.1
Improved Cocos2D API Reference (iOS version) for www.kobold2d.com developers
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Defines
CCScheduler Class Reference

List of all members.

Public Member Functions

(void) - update:
(void) - scheduleSelector:forTarget:interval:repeat:delay:paused:
(void) - scheduleSelector:forTarget:interval:paused:
(void) - scheduleUpdateForTarget:priority:paused:
(void) - scheduleBlockForKey:target:interval:repeat:delay:paused:block:
(void) - unscheduleSelector:forTarget:
(void) - unscheduleBlockForKey:target:
(void) - unscheduleUpdateForTarget:
(void) - unscheduleAllForTarget:
(void) - unscheduleAll
(void) - unscheduleAllWithMinPriority:
(void) - pauseTarget:
(void) - resumeTarget:
(BOOL) - isTargetPaused:
(NSSet *) - pauseAllTargets
(NSSet *) - pauseAllTargetsWithMinPriority:
(void) - resumeTargets:
(void) - DEPRECATED_ATTRIBUTE
(void) - scheduleSelector:forTarget:interval:paused:repeat:delay:
(void) - unscheduleAllSelectorsForTarget:
(void) - unscheduleAllSelectorsWithMinPriority:

Static Public Member Functions

(CCScheduler *) + DEPRECATED_ATTRIBUTE

Protected Attributes

ccTime _timeScale
struct _listEntry * updatesNeg
struct _listEntry * updates0
struct _listEntry * updatesPos
struct _hashUpdateEntry * hashForUpdates
struct _hashSelectorEntry * hashForTimers
struct _hashSelectorEntry * currentTarget
BOOL currentTargetSalvaged
TICK_IMP impMethod
SEL updateSelector
BOOL updateHashLocked

Properties

ccTime timeScale

Member Function Documentation

- (BOOL) isTargetPaused: (id)  target

Returns whether or not the target is paused

Since:
v1.0.0
- (NSSet*) pauseAllTargets

Pause all selectors and blocks from all targets. You should NEVER call this method, unless you know what you are doing.

Since:
v2.0.0
- (NSSet*) pauseAllTargetsWithMinPriority: (NSInteger)  minPriority

Pause all selectors and blocks from all targets with a minimum priority. You should only call this with kCCPriorityNonSystemMin or higher.

Since:
v2.0.0
- (void) pauseTarget: (id)  target

Pauses the target. All scheduled selectors/update for a given target won't be 'ticked' until the target is resumed. If the target is not present, nothing happens.

Since:
v0.99.3
- (void) resumeTarget: (id)  target

Resumes the target. The 'target' will be unpaused, so all schedule selectors/update will be 'ticked' again. If the target is not present, nothing happens.

Since:
v0.99.3
- (void) resumeTargets: (NSSet *)  targetsToResume

Resume selectors on a set of targets. This can be useful for undoing a call to pauseAllSelectors.

Since:
v2.0.0
- (void) scheduleBlockForKey: (NSString *)  key
target: (id)  target
interval: (ccTime interval
repeat: (uint)  repeat
delay: (ccTime delay
paused: (BOOL)  paused
block: (ccTime dt)  block 

The scheduled block will be called every 'interval' seconds. 'key' is a unique identifier of the block. Needed to unschedule the block or update its interval. 'target' is needed for all the method related to "target" like "pause" and "unschedule" If 'interval' is 0, it will be called every frame, but if so, it recommended to use 'scheduleUpdateForTarget:' instead. 'repeat' lets the action be repeated repeat + 1 times, use kCCRepeatForever to let the action run continuously. 'delay' is the amount of time the action will wait before it'll start. If paused is YES, then it won't be called until it is resumed. If the block is already scheduled, then only the interval parameter will be updated without re-scheduling it again.

Since:
v2.1
- (void) scheduleSelector: (SEL)  selector
forTarget: (id)  target
interval: (ccTime interval
paused: (BOOL)  paused 

calls scheduleSelector with kCCRepeatForever and a 0 delay

- (void) scheduleSelector: (SEL)  selector
forTarget: (id)  target
interval: (ccTime interval
repeat: (uint)  repeat
delay: (ccTime delay
paused: (BOOL)  paused 

The scheduled method will be called every 'interval' seconds. If paused is YES, then it won't be called until it is resumed. If 'interval' is 0, it will be called every frame, but if so, it recommended to use 'scheduleUpdateForTarget:' instead. If the selector is already scheduled, then only the interval parameter will be updated without re-scheduling it again. repeat lets the action be repeated repeat + 1 times, use kCCRepeatForever to let the action run continuously delay is the amount of time the action will wait before it'll start

Since:
v0.99.3, repeat and delay added in v1.1
- (void) scheduleUpdateForTarget: (id)  target
priority: (NSInteger)  priority
paused: (BOOL)  paused 

Schedules the 'update' selector for a given target with a given priority. The 'update' selector will be called every frame. The lower the priority, the earlier it is called.

Since:
v0.99.3
- (void) unscheduleAll

Unschedules all selectors and blocks from all targets. You should NEVER call this method, unless you know what you are doing.

Since:
v0.99.3
- (void) unscheduleAllForTarget: (id)  target

Unschedules all selectors and blocks for a given target. This also includes the "update" selector.

Since:
v0.99.3
- (void) unscheduleAllWithMinPriority: (NSInteger)  minPriority

Unschedules all selectors and blocks from all targets with a minimum priority. You should only call this with kCCPriorityNonSystemMin or higher.

Since:
v2.0.0
- (void) unscheduleBlockForKey: (NSString *)  key
target: (id)  target 

Unshedules a block for a given key / target pair. If you want to unschedule the "update", use unscheudleUpdateForTarget.

Since:
v2.1
- (void) unscheduleSelector: (SEL)  selector
forTarget: (id)  target 

Unshedules a selector for a given target. If you want to unschedule the "update", use unscheudleUpdateForTarget.

Since:
v0.99.3
- (void) unscheduleUpdateForTarget: (id)  target

Unschedules the update selector for a given target

Since:
v0.99.3
- (void) update: (ccTime dt

'update' the scheduler. You should NEVER call this method, unless you know what you are doing.


Property Documentation

- (ccTime) timeScale [read, write, assign]

Modifies the time of all scheduled callbacks. You can use this property to create a 'slow motion' or 'fast forward' effect. Default is 1.0. To create a 'slow motion' effect, use values below 1.0. To create a 'fast forward' effect, use values higher than 1.0.

Since:
v0.8
Warning:
It will affect EVERY scheduled selector / action.

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