Skip to content

Commit 2ab4059

Browse files
committed
Merge branch 'master' of https://github.com/cocos2d/cocos2d-html5 into iss1518_MouseDispatcher
2 parents 6d72e0c + 48ffe89 commit 2ab4059

File tree

2 files changed

+29
-29
lines changed

2 files changed

+29
-29
lines changed

cocos2d/CCScheduler.js

+18-18
Original file line numberDiff line numberDiff line change
@@ -625,11 +625,11 @@ cc.Scheduler = cc.Class.extend(/** @lends cc.Scheduler# */{
625625
* @param {Boolean} paused
626626
* @example
627627
* //register a schedule to scheduler
628-
* cc.Director.getInstance().getScheduler().scheduleSelector(selector, this, interval, !this._isRunning);
628+
* cc.Director.getInstance().getScheduler().scheduleCallback(function, this, interval, !this._isRunning);
629629
*/
630-
scheduleSelector:function (selector, target, interval, paused, repeat, delay) {
631-
cc.Assert(selector, "scheduler.scheduleSelector() Argument selector must be non-NULL");
632-
cc.Assert(target, "scheduler.scheduleSelector() Argument target must be non-NULL");
630+
scheduleCallback:function (selector, target, interval, paused, repeat, delay) {
631+
cc.Assert(selector, "scheduler.scheduleCallback() Argument selector must be non-NULL");
632+
cc.Assert(target, "scheduler.scheduleCallback() Argument target must be non-NULL");
633633

634634
repeat = (repeat == null) ? cc.REPEAT_FOREVER : repeat;
635635
delay = delay || 0;
@@ -651,7 +651,7 @@ cc.Scheduler = cc.Class.extend(/** @lends cc.Scheduler# */{
651651
for (var i = 0; i < element.timers.length; i++) {
652652
timer = element.timers[i];
653653
if (selector == timer._selector) {
654-
cc.log("CCSheduler#scheduleSelector. Selector already scheduled. Updating interval from:"
654+
cc.log("CCSheduler#scheduleCallback. Callback already scheduled. Updating interval from:"
655655
+ timer.getInterval().toFixed(4) + " to " + interval.toFixed(4));
656656
timer._interval = interval;
657657
return;
@@ -703,16 +703,16 @@ cc.Scheduler = cc.Class.extend(/** @lends cc.Scheduler# */{
703703

704704
/**
705705
* <p>
706-
* Unschedule a selector for a given target.<br/>
706+
* Unschedule a callback function for a given target.<br/>
707707
* If you want to unschedule the "update", use unscheudleUpdateForTarget.
708708
* </p>
709709
* @param {function} selector
710710
* @param {cc.Class} target
711711
* @example
712712
* //unschedule a selector of target
713-
* cc.Director.getInstance().getScheduler().unscheduleSelector(selector, this);
713+
* cc.Director.getInstance().getScheduler().unscheduleCallback(function, this);
714714
*/
715-
unscheduleSelector:function (selector, target) {
715+
unscheduleCallback:function (selector, target) {
716716
// explicity handle nil arguments when removing an object
717717
if ((target == null) || (selector == null)) {
718718
return;
@@ -769,10 +769,10 @@ cc.Scheduler = cc.Class.extend(/** @lends cc.Scheduler# */{
769769
},
770770

771771
/**
772-
* Unschedules all selectors for a given target. This also includes the "update" selector.
772+
* Unschedules all function callbacks for a given target. This also includes the "update" callback function.
773773
* @param {cc.Class} target
774774
*/
775-
unscheduleAllSelectorsForTarget:function (target) {
775+
unscheduleAllCallbacksForTarget:function (target) {
776776
//explicit NULL handling
777777
if (target == null) {
778778
return;
@@ -797,27 +797,27 @@ cc.Scheduler = cc.Class.extend(/** @lends cc.Scheduler# */{
797797

798798
/**
799799
* <p>
800-
* Unschedules all selectors from all targets. <br/>
800+
* Unschedules all function callbacks from all targets. <br/>
801801
* You should NEVER call this method, unless you know what you are doing.
802802
* </p>
803803
*/
804-
unscheduleAllSelectors:function () {
805-
this.unscheduleAllSelectorsWithMinPriority(cc.PRIORITY_SYSTEM);
804+
unscheduleAllCallbacks:function () {
805+
this.unscheduleAllCallbacksWithMinPriority(cc.PRIORITY_SYSTEM);
806806
},
807807

808808
/**
809809
* <p>
810-
* Unschedules all selectors from all targets with a minimum priority.<br/>
810+
* Unschedules all function callbacks from all targets with a minimum priority.<br/>
811811
* You should only call this with kCCPriorityNonSystemMin or higher.
812812
* </p>
813813
* @param {Number} minPriority
814814
*/
815-
unscheduleAllSelectorsWithMinPriority:function (minPriority) {
815+
unscheduleAllCallbacksWithMinPriority:function (minPriority) {
816816
// Custom Selectors
817817
var i;
818818
for (i = 0; i < this._hashForSelectors.length; i++) {
819-
// element may be removed in unscheduleAllSelectorsForTarget
820-
this.unscheduleAllSelectorsForTarget(this._hashForSelectors[i].target);
819+
// element may be removed in unscheduleAllCallbacksForTarget
820+
this.unscheduleAllCallbacksForTarget(this._hashForSelectors[i].target);
821821
}
822822

823823
//updates selectors
@@ -902,7 +902,7 @@ cc.Scheduler = cc.Class.extend(/** @lends cc.Scheduler# */{
902902

903903
/**
904904
* Resume selectors on a set of targets.<br/>
905-
* This can be useful for undoing a call to pauseAllSelectors.
905+
* This can be useful for undoing a call to pauseAllCallbacks.
906906
* @param targetsToResume
907907
*/
908908
resumeTargets:function (targetsToResume) {

cocos2d/base_nodes/CCNode.js

+11-11
Original file line numberDiff line numberDiff line change
@@ -920,7 +920,7 @@ cc.Node = cc.Class.extend(/** @lends cc.Node# */{
920920
*/
921921
setScheduler:function (scheduler) {
922922
if (this._scheduler != scheduler) {
923-
this.unscheduleAllSelectors();
923+
this.unscheduleAllCallbacks();
924924
this._scheduler = scheduler;
925925
}
926926
},
@@ -962,7 +962,7 @@ cc.Node = cc.Class.extend(/** @lends cc.Node# */{
962962
cleanup:function () {
963963
// actions
964964
this.stopAllActions();
965-
this.unscheduleAllSelectors();
965+
this.unscheduleAllCallbacks();
966966

967967
// timers
968968
this._arrayMakeObjectsPerformSelector(this._children, cc.Node.StateCallbackType.cleanup);
@@ -1545,7 +1545,7 @@ cc.Node = cc.Class.extend(/** @lends cc.Node# */{
15451545
},
15461546

15471547
/**
1548-
* schedule
1548+
* schedules a callback function with interval, repeat and delay.
15491549
* @param {function} selector
15501550
* @param {Number} interval
15511551
*/
@@ -1558,11 +1558,11 @@ cc.Node = cc.Class.extend(/** @lends cc.Node# */{
15581558
repeat = (repeat == null) ? cc.REPEAT_FOREVER : repeat;
15591559
delay = delay || 0;
15601560

1561-
this.getScheduler().scheduleSelector(selector, this, interval, !this._isRunning, repeat, delay);
1561+
this.getScheduler().scheduleCallback(selector, this, interval, !this._isRunning, repeat, delay);
15621562
},
15631563

15641564
/**
1565-
* Schedules a selector that runs only once, with a delay of 0 or larger
1565+
* Schedules a callback function that runs only once, with a delay of 0 or larger
15661566
* @param {cc.Class} selector
15671567
* @param {Number} delay
15681568
*/
@@ -1571,27 +1571,27 @@ cc.Node = cc.Class.extend(/** @lends cc.Node# */{
15711571
},
15721572

15731573
/**
1574-
* unschedules a custom selector.
1574+
* unschedules a custom callback function.
15751575
* @param {function} selector
15761576
*/
15771577
unschedule:function (selector) {
15781578
// explicit nil handling
15791579
if (!selector)
15801580
return;
15811581

1582-
this.getScheduler().unscheduleSelector(selector, this);
1582+
this.getScheduler().unscheduleCallback(selector, this);
15831583
},
15841584

15851585
/**
1586-
* unschedule all scheduled selectors: custom selectors, and the 'update' selector.<br/>
1586+
* unschedule all scheduled callback functions: custom callback functions, and the 'update' callback function.<br/>
15871587
* Actions are not affected by this method.
15881588
*/
1589-
unscheduleAllSelectors:function () {
1590-
this.getScheduler().unscheduleAllSelectorsForTarget(this);
1589+
unscheduleAllCallbacks:function () {
1590+
this.getScheduler().unscheduleAllCallbacksForTarget(this);
15911591
},
15921592

15931593
/**
1594-
* resumes all scheduled selectors and actions.<br/>
1594+
* resumes all scheduled callback functions and actions.<br/>
15951595
* Called internally by onEnter
15961596
*/
15971597
resumeSchedulerAndActions:function () {

0 commit comments

Comments
 (0)