Skip to content

Commit b5c1a11

Browse files
author
AT2014
committed
Added reschedule method to CCNode header
Added reschedule:interval: method to CCNode header file.
1 parent c4bc3e0 commit b5c1a11

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

cocos2d/CCNode.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,17 @@ A common user pattern in building a Cocos2d game is to subclass CCNode, add it t
552552
*
553553
* @return A newly initialized CCTimer object.
554554
*/
555+
556+
/**
557+
* Schedules a custom selector with an interval time in seconds.
558+
* If the custom selector you pass in is not already scheduled, this method simply schedules it for the first time.
559+
* The difference between this method and the schedule:interval: method is that if the selector passed in this method is already scheduled, calling this method will only adjust the interval on the already scheduled method. In contrast, when you call schedule:interval: on an already scheduled selector, your custom selector will be unscheduled and then rescheduled.
560+
* @param s Selector to execute.
561+
* @param seconds Interval between execution in seconds.
562+
*/
563+
-(CCTimer*)reschedule:(SEL)selector interval:(CCTime)interval;
564+
565+
555566
- (CCTimer *) scheduleOnce:(SEL) selector delay:(CCTime) delay;
556567

557568
/**

0 commit comments

Comments
 (0)