1 /****************************************************************************
  2  Copyright (c) 2008-2010 Ricardo Quesada
  3  Copyright (c) 2011-2012 cocos2d-x.org
  4  Copyright (c) 2013-2014 Chukong Technologies Inc.
  5 
  6  http://www.cocos2d-x.org
  7 
  8  Permission is hereby granted, free of charge, to any person obtaining a copy
  9  of this software and associated documentation files (the "Software"), to deal
 10  in the Software without restriction, including without limitation the rights
 11  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 12  copies of the Software, and to permit persons to whom the Software is
 13  furnished to do so, subject to the following conditions:
 14 
 15  The above copyright notice and this permission notice shall be included in
 16  all copies or substantial portions of the Software.
 17 
 18  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 19  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 20  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 21  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 22  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 23  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 24  THE SOFTWARE.
 25  ****************************************************************************/
 26 /**
 27  * A tag constant for identifying fade scenes
 28  * @constant
 29  * @type Number
 30  */
 31 cc.SCENE_FADE = 4208917214;
 32 
 33 /**
 34  * horizontal orientation Type where the Left is nearer
 35  * @constant
 36  * @type Number
 37  */
 38 cc.TRANSITION_ORIENTATION_LEFT_OVER = 0;
 39 /**
 40  * horizontal orientation type where the Right is nearer
 41  * @constant
 42  * @type Number
 43  */
 44 cc.TRANSITION_ORIENTATION_RIGHT_OVER = 1;
 45 /**
 46  * vertical orientation type where the Up is nearer
 47  * @constant
 48  * @type Number
 49  */
 50 cc.TRANSITION_ORIENTATION_UP_OVER = 0;
 51 /**
 52  * vertical orientation type where the Bottom is nearer
 53  * @constant
 54  * @type Number
 55  */
 56 cc.TRANSITION_ORIENTATION_DOWN_OVER = 1;
 57 
 58 /**
 59  * @class
 60  * @extends cc.Scene
 61  * @param {Number} t time in seconds
 62  * @param {cc.Scene} scene the scene to transit with
 63  * @example
 64  * var trans = new TransitionScene(time,scene);
 65  */
 66 cc.TransitionScene = cc.Scene.extend(/** @lends cc.TransitionScene# */{
 67     _inScene:null,
 68     _outScene:null,
 69     _duration:null,
 70     _isInSceneOnTop:false,
 71     _isSendCleanupToScene:false,
 72     _className:"TransitionScene",
 73 
 74     /**
 75      * creates a base transition with duration and incoming scene
 76      * Constructor of cc.TransitionScene
 77      * @param {Number} t time in seconds
 78      * @param {cc.Scene} scene the scene to transit with
 79      */
 80     ctor:function (t, scene) {
 81         cc.Scene.prototype.ctor.call(this);
 82         if(t !== undefined && scene !== undefined)
 83             this.initWithDuration(t, scene);
 84     },
 85 
 86     //private
 87     _setNewScene:function (dt) {
 88         this.unschedule(this._setNewScene);
 89         // Before replacing, save the "send cleanup to scene"
 90         var director = cc.director;
 91         this._isSendCleanupToScene = director.isSendCleanupToScene();
 92         director.runScene(this._inScene);
 93 
 94         // enable events while transitions
 95         cc.eventManager.setEnabled(true);
 96 
 97         // issue #267
 98         this._outScene.visible = true;
 99     },
100 
101     //protected
102     _sceneOrder:function () {
103         this._isInSceneOnTop = true;
104     },
105 
106     /**
107      * stuff gets drawn here
108      */
109     visit:function () {
110         if (this._isInSceneOnTop) {
111             this._outScene.visit();
112             this._inScene.visit();
113         } else {
114             this._inScene.visit();
115             this._outScene.visit();
116         }
117         cc.Node.prototype.visit.call(this);
118     },
119 
120     /**
121      *  <p>
122      *     Event callback that is invoked every time when cc.TransitionScene enters the 'stage'.                                   <br/>
123      *     If the TransitionScene enters the 'stage' with a transition, this event is called when the transition starts.        <br/>
124      *     During onEnter you can't access a "sister/brother" node.                                                    <br/>
125      *     If you override onEnter, you must call its parent's onEnter function with this._super().
126      * </p>
127      */
128     onEnter:function () {
129         cc.Node.prototype.onEnter.call(this);
130 
131         // disable events while transitions
132         cc.eventManager.setEnabled(false);
133 
134         // outScene should not receive the onEnter callback
135         // only the onExitTransitionDidStart
136         this._outScene.onExitTransitionDidStart();
137 
138         this._inScene.onEnter();
139     },
140 
141     /**
142      *  <p>
143      * callback that is called every time the cc.TransitionScene leaves the 'stage'.                                         <br/>
144      * If the cc.TransitionScene leaves the 'stage' with a transition, this callback is called when the transition finishes. <br/>
145      * During onExit you can't access a sibling node.                                                             <br/>
146      * If you override onExit, you shall call its parent's onExit with this._super().
147      * </p>
148      */
149     onExit:function () {
150         cc.Node.prototype.onExit.call(this);
151 
152         // enable events while transitions
153         cc.eventManager.setEnabled(true);
154 
155         this._outScene.onExit();
156 
157         // _inScene should not receive the onEnter callback
158         // only the onEnterTransitionDidFinish
159         this._inScene.onEnterTransitionDidFinish();
160     },
161 
162     /**
163      * custom cleanup
164      */
165     cleanup:function () {
166         cc.Node.prototype.cleanup.call(this);
167 
168         if (this._isSendCleanupToScene)
169             this._outScene.cleanup();
170     },
171 
172     /**
173      * initializes a transition with duration and incoming scene
174      * @param {Number} t time in seconds
175      * @param {cc.Scene} scene a scene to transit to
176      * @return {Boolean} return false if error
177      */
178     initWithDuration:function (t, scene) {
179         if(!scene)
180             throw new Error("cc.TransitionScene.initWithDuration(): Argument scene must be non-nil");
181 
182         if (this.init()) {
183             this._duration = t;
184             this.attr({
185 	            x: 0,
186 	            y: 0,
187 	            anchorX: 0,
188 	            anchorY: 0
189             });
190             // retain
191             this._inScene = scene;
192             this._outScene = cc.director.getRunningScene();
193             if (!this._outScene) {
194                 this._outScene = new cc.Scene();
195                 this._outScene.init();
196             }
197 
198             if(this._inScene === this._outScene)
199                 throw new Error("cc.TransitionScene.initWithDuration(): Incoming scene must be different from the outgoing scene");
200 
201             this._sceneOrder();
202             return true;
203         } else {
204             return false;
205         }
206     },
207 
208     /**
209      * called after the transition finishes
210      */
211     finish:function () {
212         // clean up
213         this._inScene.attr({
214 			visible: true,
215 	        x: 0,
216 	        y: 0,
217 	        scale: 1.0,
218 	        rotation: 0.0
219         });
220         if(cc._renderType === cc._RENDER_TYPE_WEBGL)
221             this._inScene.getCamera().restore();
222 
223         this._outScene.attr({
224 	        visible: false,
225 	        x: 0,
226 	        y: 0,
227 	        scale: 1.0,
228 	        rotation: 0.0
229         });
230         if(cc._renderType === cc._RENDER_TYPE_WEBGL)
231             this._outScene.getCamera().restore();
232 
233         //[self schedule:@selector(setNewScene:) interval:0];
234         this.schedule(this._setNewScene, 0);
235     },
236 
237     /**
238      * set hide the out scene and show in scene
239      */
240     hideOutShowIn:function () {
241         this._inScene.visible = true;
242         this._outScene.visible = false;
243     }
244 });
245 /**
246  * creates a base transition with duration and incoming scene
247  * @deprecated since v3.0, please use new cc.TransitionScene(t,scene) instead
248  * @param {Number} t time in seconds
249  * @param {cc.Scene} scene the scene to transit with
250  * @return {cc.TransitionScene|Null}
251  */
252 cc.TransitionScene.create = function (t, scene) {
253     return new cc.TransitionScene(t, scene);
254 };
255 
256 /**
257  * A cc.Transition that supports orientation like.<br/>
258  * Possible orientation: LeftOver, RightOver, UpOver, DownOver<br/>
259  * useful for when you want to make a transition happen between 2 orientations
260  * @class
261  * @extends cc.TransitionScene
262  * @param {Number} t time in seconds
263  * @param {cc.Scene} scene
264  * @param {cc.TRANSITION_ORIENTATION_LEFT_OVER|cc.TRANSITION_ORIENTATION_RIGHT_OVER|cc.TRANSITION_ORIENTATION_UP_OVER|cc.TRANSITION_ORIENTATION_DOWN_OVER} orientation
265  * @example
266  * var trans = new cc.TransitionSceneOriented(time,scene,orientation);
267  */
268 cc.TransitionSceneOriented = cc.TransitionScene.extend(/** @lends cc.TransitionSceneOriented# */{
269     _orientation:0,
270 
271     /**
272      * Constructor of TransitionSceneOriented
273      * @param {Number} t time in seconds
274      * @param {cc.Scene} scene
275      * @param {cc.TRANSITION_ORIENTATION_LEFT_OVER|cc.TRANSITION_ORIENTATION_RIGHT_OVER|cc.TRANSITION_ORIENTATION_UP_OVER|cc.TRANSITION_ORIENTATION_DOWN_OVER} orientation
276      */
277     ctor:function (t, scene, orientation) {
278         cc.TransitionScene.prototype.ctor.call(this);
279         orientation != undefined && this.initWithDuration(t, scene, orientation);
280     },
281     /**
282      * initialize the transition
283      * @param {Number} t time in seconds
284      * @param {cc.Scene} scene
285      * @param {cc.TRANSITION_ORIENTATION_LEFT_OVER|cc.TRANSITION_ORIENTATION_RIGHT_OVER|cc.TRANSITION_ORIENTATION_UP_OVER|cc.TRANSITION_ORIENTATION_DOWN_OVER} orientation
286      * @return {Boolean}
287      */
288     initWithDuration:function (t, scene, orientation) {
289         if (cc.TransitionScene.prototype.initWithDuration.call(this, t, scene)) {
290             this._orientation = orientation;
291         }
292         return true;
293     }
294 });
295 
296 /**
297  * creates a base transition with duration and incoming scene
298  * @deprecated since v3.0 ,please use new cc.TransitionSceneOriented(t, scene, orientation) instead.
299  * @param {Number} t time in seconds
300  * @param {cc.Scene} scene
301  * @param {cc.TRANSITION_ORIENTATION_LEFT_OVER|cc.TRANSITION_ORIENTATION_RIGHT_OVER|cc.TRANSITION_ORIENTATION_UP_OVER|cc.TRANSITION_ORIENTATION_DOWN_OVER} orientation
302  * @return {cc.TransitionSceneOriented}
303  */
304 cc.TransitionSceneOriented.create = function (t, scene, orientation) {
305     return new cc.TransitionSceneOriented(t, scene, orientation);
306 };
307 
308 /**
309  *  Rotate and zoom out the outgoing scene, and then rotate and zoom in the incoming
310  * @class
311  * @extends cc.TransitionScene
312  * @param {Number} t time in seconds
313  * @param {cc.Scene} scene
314  * @example
315  * var trans = new cc.TransitionRotoZoom(t, scene);
316  */
317 cc.TransitionRotoZoom = cc.TransitionScene.extend(/** @lends cc.TransitionRotoZoom# */{
318 
319     /**
320      * Constructor of TransitionRotoZoom
321      * @function
322      * @param {Number} t time in seconds
323      * @param {cc.Scene} scene
324      */
325     ctor:function (t, scene) {
326         cc.TransitionScene.prototype.ctor.call(this);
327         scene && this.initWithDuration(t, scene);
328     },
329     /**
330      * Custom On Enter callback
331      * @override
332      */
333     onEnter:function () {
334         cc.TransitionScene.prototype.onEnter.call(this);
335 
336 	    this._inScene.attr({
337 		    scale: 0.001,
338 		    anchorX: 0.5,
339 		    anchorY: 0.5
340 	    });
341 	    this._outScene.attr({
342 		    scale: 1.0,
343 		    anchorX: 0.5,
344 		    anchorY: 0.5
345 	    });
346 
347         var rotoZoom = cc.sequence(
348             cc.spawn(cc.scaleBy(this._duration / 2, 0.001),
349                 cc.rotateBy(this._duration / 2, 360 * 2)),
350             cc.delayTime(this._duration / 2));
351 
352         this._outScene.runAction(rotoZoom);
353         this._inScene.runAction(
354             cc.sequence(rotoZoom.reverse(),
355                 cc.callFunc(this.finish, this)));
356     }
357 });
358 
359 /**
360  * Creates a Transtion rotation and zoom
361  * @deprecated since v3.0,please use new cc.TransitionRotoZoom(t, scene) instead
362  * @param {Number} t time in seconds
363  * @param {cc.Scene} scene the scene to work with
364  * @return {cc.TransitionRotoZoom}
365  */
366 cc.TransitionRotoZoom.create = function (t, scene) {
367     return new cc.TransitionRotoZoom(t, scene);
368 };
369 
370 /**
371  * Zoom out and jump the outgoing scene, and then jump and zoom in the incoming
372  * @class
373  * @extends cc.TransitionScene
374  * @param {Number} t time in seconds
375  * @param {cc.Scene} scene
376  * @example
377  * var trans = new cc.TransitionJumpZoom(t, scene);
378  */
379 cc.TransitionJumpZoom = cc.TransitionScene.extend(/** @lends cc.TransitionJumpZoom# */{
380     /**
381      * Constructor of TransitionJumpZoom
382      * @param {Number} t time in seconds
383      * @param {cc.Scene} scene
384      */
385     ctor:function (t, scene) {
386         cc.TransitionScene.prototype.ctor.call(this);
387         scene && this.initWithDuration(t, scene);
388     },
389     /**
390      * Custom on enter
391      */
392     onEnter:function () {
393         cc.TransitionScene.prototype.onEnter.call(this);
394         var winSize = cc.director.getWinSize();
395 
396 	    this._inScene.attr({
397 		    scale: 0.5,
398 		    x: winSize.width,
399 		    y: 0,
400 		    anchorX: 0.5,
401 		    anchorY: 0.5
402 	    });
403         this._outScene.anchorX = 0.5;
404 	    this._outScene.anchorY = 0.5;
405 
406         var jump = cc.jumpBy(this._duration / 4, cc.p(-winSize.width, 0), winSize.width / 4, 2);
407         var scaleIn = cc.scaleTo(this._duration / 4, 1.0);
408         var scaleOut = cc.scaleTo(this._duration / 4, 0.5);
409 
410         var jumpZoomOut = cc.sequence(scaleOut, jump);
411         var jumpZoomIn = cc.sequence(jump, scaleIn);
412 
413         var delay = cc.delayTime(this._duration / 2);
414         this._outScene.runAction(jumpZoomOut);
415         this._inScene.runAction(cc.sequence(delay, jumpZoomIn, cc.callFunc(this.finish, this)));
416     }
417 });
418 
419 /**
420  * creates a scene transition that zooms then jump across the screen, the same for the incoming scene
421  * @deprecated since v3.0,please use new cc.TransitionJumpZoom(t, scene);
422  * @param {Number} t time in seconds
423  * @param {cc.Scene} scene
424  * @return {cc.TransitionJumpZoom}
425  */
426 cc.TransitionJumpZoom.create = function (t, scene) {
427     return new cc.TransitionJumpZoom(t, scene);
428 };
429 
430 /**
431  * Move in from to the left the incoming scene.
432  * @class
433  * @extends cc.TransitionScene
434  * @param {Number} t time in seconds
435  * @param {cc.Scene} scene
436  * @example
437  * var trans = new cc.TransitionMoveInL(time,scene);
438  */
439 cc.TransitionMoveInL = cc.TransitionScene.extend(/** @lends cc.TransitionMoveInL# */{
440     /**
441      * Constructor of TransitionMoveInL
442      * @param {Number} t time in seconds
443      * @param {cc.Scene} scene
444      */
445     ctor:function (t, scene) {
446         cc.TransitionScene.prototype.ctor.call(this);
447         scene && this.initWithDuration(t, scene);
448     },
449     /**
450      * Custom on enter
451      */
452     onEnter:function () {
453         cc.TransitionScene.prototype.onEnter.call(this);
454         this.initScenes();
455 
456         var action = this.action();
457         this._inScene.runAction(
458             cc.sequence(this.easeActionWithAction(action), cc.callFunc(this.finish, this))
459         );
460     },
461 
462     /**
463      * initializes the scenes
464      */
465     initScenes:function () {
466         this._inScene.setPosition(-cc.director.getWinSize().width, 0);
467     },
468 
469     /**
470      * returns the action that will be performed
471      */
472     action:function () {
473         return cc.moveTo(this._duration, cc.p(0, 0));
474     },
475 
476     /**
477      * creates an ease action from action
478      * @param {cc.ActionInterval} action
479      * @return {cc.EaseOut}
480      */
481     easeActionWithAction:function (action) {
482         return new cc.EaseOut(action, 2.0);
483     }
484 });
485 
486 /**
487  * creates an action that  Move in from to the left the incoming scene.
488  * @deprecated since v3.0,please use new cc.TransitionMoveInL(t, scene) instead
489  * @param {Number} t time in seconds
490  * @param {cc.Scene} scene
491  * @return {cc.TransitionMoveInL}
492  */
493 cc.TransitionMoveInL.create = function (t, scene) {
494     return new cc.TransitionMoveInL(t, scene);
495 };
496 
497 /**
498  * Move in from to the right the incoming scene.
499  * @class
500  * @extends cc.TransitionMoveInL
501  * @param {Number} t time in seconds
502  * @param {cc.Scene} scene
503  * @example
504  * var trans = new cc.TransitionMoveInR(time,scene);
505  */
506 cc.TransitionMoveInR = cc.TransitionMoveInL.extend(/** @lends cc.TransitionMoveInR# */{
507     /**
508      * Constructor of TransitionMoveInR
509      * @param {Number} t time in seconds
510      * @param {cc.Scene} scene
511      */
512     ctor:function (t, scene) {
513         cc.TransitionMoveInL.prototype.ctor.call(this);
514         scene && this.initWithDuration(t, scene);
515     },
516     /**
517      * Init function
518      */
519     initScenes:function () {
520         this._inScene.setPosition(cc.director.getWinSize().width, 0);
521     }
522 });
523 
524 /**
525  * create a scene transition that Move in from to the right the incoming scene.
526  * @deprecated since v3.0,please use new cc.TransitionMoveInR(t, scene) instead
527  * @param {Number} t time in seconds
528  * @param {cc.Scene} scene
529  * @return {cc.TransitionMoveInR}
530  */
531 cc.TransitionMoveInR.create = function (t, scene) {
532     return new cc.TransitionMoveInR(t, scene);
533 };
534 
535 /**
536  * Move in from to the top the incoming scene.
537  * @class
538  * @extends cc.TransitionMoveInL
539  * @param {Number} t time in seconds
540  * @param {cc.Scene} scene
541  * @example
542  * var trans = new cc.TransitionMoveInT(time,scene);
543  */
544 cc.TransitionMoveInT = cc.TransitionMoveInL.extend(/** @lends cc.TransitionMoveInT# */{
545     /**
546      * Constructor of TransitionMoveInT
547      * @param {Number} t time in seconds
548      * @param {cc.Scene} scene
549      */
550     ctor:function (t, scene) {
551         cc.TransitionMoveInL.prototype.ctor.call(this);
552         scene && this.initWithDuration(t, scene);
553     },
554     /**
555      * init function
556      */
557     initScenes:function () {
558         this._inScene.setPosition(0, cc.director.getWinSize().height);
559     }
560 });
561 
562 /**
563  * Move in from to the top the incoming scene.
564  * @deprecated since v3.0,please use new cc.TransitionMoveInT(t, scene) instead
565  * @param {Number} t time in seconds
566  * @param {cc.Scene} scene
567  * @return {cc.TransitionMoveInT}
568  */
569 cc.TransitionMoveInT.create = function (t, scene) {
570     return new cc.TransitionMoveInT(t, scene);
571 };
572 
573 /**
574  *  Move in from to the bottom the incoming scene.
575  * @class
576  * @extends cc.TransitionMoveInL
577  * @param {Number} t time in seconds
578  * @param {cc.Scene} scene
579  * @example
580  * var trans = new cc.TransitionMoveInB(time,scene);
581  */
582 cc.TransitionMoveInB = cc.TransitionMoveInL.extend(/** @lends cc.TransitionMoveInB# */{
583     /**
584      * Constructor of TransitionMoveInB
585      * @param {Number} t time in seconds
586      * @param {cc.Scene} scene
587      */
588     ctor:function (t, scene) {
589         cc.TransitionMoveInL.prototype.ctor.call(this);
590         scene && this.initWithDuration(t, scene);
591     },
592 
593     /**
594      * init function
595      */
596     initScenes:function () {
597         this._inScene.setPosition(0, -cc.director.getWinSize().height);
598     }
599 });
600 
601 /**
602  * create a scene transition that Move in from to the bottom the incoming scene.
603  * @deprecated since v3.0,please use new cc.TransitionMoveInB(t, scene) instead
604  * @param {Number} t time in seconds
605  * @param {cc.Scene} scene
606  * @return {cc.TransitionMoveInB}
607  */
608 cc.TransitionMoveInB.create = function (t, scene) {
609     return new cc.TransitionMoveInB(t, scene);
610 };
611 
612 /**
613  * The adjust factor is needed to prevent issue #442<br/>
614  * One solution is to use DONT_RENDER_IN_SUBPIXELS images, but NO<br/>
615  * The other issue is that in some transitions (and I don't know why)<br/>
616  * the order should be reversed (In in top of Out or vice-versa).
617  * @constant
618  * @type Number
619  */
620 cc.ADJUST_FACTOR = 0.5;
621 
622 /**
623  * a transition that a new scene is slided from left
624  * @class
625  * @extends cc.TransitionScene
626  * @param {Number} t time in seconds
627  * @param {cc.Scene} scene
628  * @example
629  * var trans = cc.TransitionSlideInL(time,scene);
630  */
631 cc.TransitionSlideInL = cc.TransitionScene.extend(/** @lends cc.TransitionSlideInL# */{
632     /**
633      * Constructor of TransitionSlideInL
634      * @param {Number} t time in seconds
635      * @param {cc.Scene} scene
636      */
637     ctor:function (t, scene) {
638         cc.TransitionScene.prototype.ctor.call(this);
639         scene && this.initWithDuration(t, scene);
640     },
641     _sceneOrder:function () {
642         this._isInSceneOnTop = false;
643     },
644 
645     /**
646      * custom on enter
647      */
648     onEnter:function () {
649         cc.TransitionScene.prototype.onEnter.call(this);
650         this.initScenes();
651 
652         var inA = this.action();
653         var outA = this.action();
654 
655         var inAction = cc.sequence(this.easeActionWithAction(inA), cc.callFunc(this.finish, this));
656         var outAction = this.easeActionWithAction(outA);
657         this._inScene.runAction(inAction);
658         this._outScene.runAction(outAction);
659     },
660 
661     /**
662      * initializes the scenes
663      */
664     initScenes:function () {
665         this._inScene.setPosition(-cc.director.getWinSize().width + cc.ADJUST_FACTOR, 0);
666     },
667     /**
668      * returns the action that will be performed by the incomming and outgoing scene
669      * @return {cc.MoveBy}
670      */
671     action:function () {
672         return cc.moveBy(this._duration, cc.p(cc.director.getWinSize().width - cc.ADJUST_FACTOR, 0));
673     },
674 
675     /**
676      * @param {cc.ActionInterval} action
677      * @return {*}
678      */
679     easeActionWithAction:function (action) {
680         return new cc.EaseInOut(action, 2.0);
681     }
682 });
683 
684 /**
685  * create a transition that a new scene is slided from left
686  * @deprecated since v3.0,please use new cc.TransitionSlideInL(t, scene) instead
687  * @param {Number} t time in seconds
688  * @param {cc.Scene} scene
689  * @return {cc.TransitionSlideInL}
690  */
691 cc.TransitionSlideInL.create = function (t, scene) {
692     return new cc.TransitionSlideInL(t, scene);
693 };
694 
695 /**
696  *  Slide in the incoming scene from the right border.
697  * @class
698  * @extends cc.TransitionSlideInL
699  * @param {Number} t time in seconds
700  * @param {cc.Scene} scene
701  * @example
702  * var trans = new cc.TransitionSlideInR(time,scene);
703  */
704 cc.TransitionSlideInR = cc.TransitionSlideInL.extend(/** @lends cc.TransitionSlideInR# */{
705     /**
706      * Constructor of TransitionSlideInR
707      * @param {Number} t time in seconds
708      * @param {cc.Scene} scene
709      */
710     ctor:function (t, scene) {
711         cc.TransitionSlideInL.prototype.ctor.call(this);
712         scene && this.initWithDuration(t, scene);
713     },
714     _sceneOrder:function () {
715         this._isInSceneOnTop = true;
716     },
717     /**
718      * initializes the scenes
719      */
720     initScenes:function () {
721         this._inScene.setPosition(cc.director.getWinSize().width - cc.ADJUST_FACTOR, 0);
722     },
723     /**
724      *  returns the action that will be performed by the incomming and outgoing scene
725      * @return {cc.MoveBy}
726      */
727     action:function () {
728         return cc.moveBy(this._duration, cc.p(-(cc.director.getWinSize().width - cc.ADJUST_FACTOR), 0));
729     }
730 });
731 
732 /**
733  * create Slide in the incoming scene from the right border.
734  * @deprecated since v3.0,please use new cc.TransitionSlideInR(t, scene) instead
735  * @param {Number} t time in seconds
736  * @param {cc.Scene} scene
737  * @return {cc.TransitionSlideInR}
738  */
739 cc.TransitionSlideInR.create = function (t, scene) {
740     return new cc.TransitionSlideInR(t, scene);
741 };
742 
743 /**
744  * Slide in the incoming scene from the bottom border.
745  * @class
746  * @extends cc.TransitionSlideInL
747  * @param {Number} t time in seconds
748  * @param {cc.Scene} scene
749  * @example
750  * var trans = new cc.TransitionSlideInB(time,scene);
751  */
752 cc.TransitionSlideInB = cc.TransitionSlideInL.extend(/** @lends cc.TransitionSlideInB# */{
753     /**
754      * Constructor of TransitionSlideInB
755      * @param {Number} t time in seconds
756      * @param {cc.Scene} scene
757      */
758     ctor:function (t, scene) {
759         cc.TransitionSlideInL.prototype.ctor.call(this);
760         scene && this.initWithDuration(t, scene);
761     },
762     _sceneOrder:function () {
763         this._isInSceneOnTop = false;
764     },
765 
766     /**
767      * initializes the scenes
768      */
769     initScenes:function () {
770         this._inScene.setPosition(0, -(cc.director.getWinSize().height - cc.ADJUST_FACTOR));
771     },
772 
773     /**
774      * returns the action that will be performed by the incomming and outgoing scene
775      * @return {cc.MoveBy}
776      */
777     action:function () {
778         return cc.moveBy(this._duration, cc.p(0, cc.director.getWinSize().height - cc.ADJUST_FACTOR));
779     }
780 });
781 
782 /**
783  * create a Slide in the incoming scene from the bottom border.
784  * @deprecated since v3.0,please use new cc.TransitionSlideInB(t, scene) instead.
785  * @param {Number} t time in seconds
786  * @param {cc.Scene} scene
787  * @return {cc.TransitionSlideInB}
788  */
789 cc.TransitionSlideInB.create = function (t, scene) {
790     return new cc.TransitionSlideInB(t, scene);
791 };
792 
793 /**
794  *  Slide in the incoming scene from the top border.
795  *  @class
796  *  @extends cc.TransitionSlideInL
797  *  @param {Number} t time in seconds
798  *  @param {cc.Scene} scene
799  *  @example
800  *  var trans = new cc.TransitionSlideInT(time,scene);
801  */
802 cc.TransitionSlideInT = cc.TransitionSlideInL.extend(/** @lends cc.TransitionSlideInT# */{
803     /**
804      * Constructor of TransitionSlideInT
805      * @param {Number} t time in seconds
806      * @param {cc.Scene} scene
807      */
808     ctor:function (t, scene) {
809         cc.TransitionSlideInL.prototype.ctor.call(this);
810         scene && this.initWithDuration(t, scene);
811     },
812     _sceneOrder:function () {
813         this._isInSceneOnTop = true;
814     },
815 
816     /**
817      * initializes the scenes
818      */
819     initScenes:function () {
820         this._inScene.setPosition(0, cc.director.getWinSize().height - cc.ADJUST_FACTOR);
821     },
822 
823     /**
824      * returns the action that will be performed by the incomming and outgoing scene
825      * @return {cc.MoveBy}
826      */
827     action:function () {
828         return cc.moveBy(this._duration, cc.p(0, -(cc.director.getWinSize().height - cc.ADJUST_FACTOR)));
829     }
830 });
831 
832 /**
833  * create a Slide in the incoming scene from the top border.
834  * @deprecated since v3.0,please use new cc.TransitionSlideInT(t, scene) instead.
835  * @param {Number} t time in seconds
836  * @param {cc.Scene} scene
837  * @return {cc.TransitionSlideInT}
838  */
839 cc.TransitionSlideInT.create = function (t, scene) {
840     return new cc.TransitionSlideInT(t, scene);
841 };
842 
843 /**
844  * Shrink the outgoing scene while grow the incoming scene
845  * @class
846  * @extends cc.TransitionScene
847  * @param {Number} t time in seconds
848  * @param {cc.Scene} scene
849  * @example
850  * var trans = new cc.TransitionShrinkGrow(time,scene);
851  */
852 cc.TransitionShrinkGrow = cc.TransitionScene.extend(/** @lends cc.TransitionShrinkGrow# */{
853     /**
854      * Constructor of TransitionShrinkGrow
855      * @param {Number} t time in seconds
856      * @param {cc.Scene} scene
857      */
858     ctor:function (t, scene) {
859         cc.TransitionScene.prototype.ctor.call(this);
860         scene && this.initWithDuration(t, scene);
861     },
862     /**
863      * Custom on enter
864      */
865     onEnter:function () {
866         cc.TransitionScene.prototype.onEnter.call(this);
867 
868 	    this._inScene.attr({
869 		    scale: 0.001,
870 		    anchorX: 2 / 3.0,
871 		    anchorY: 0.5
872 	    });
873 	    this._outScene.attr({
874 		    scale: 1.0,
875 		    anchorX: 1 / 3.0,
876 		    anchorY: 0.5
877 	    });
878 
879         var scaleOut = cc.scaleTo(this._duration, 0.01);
880         var scaleIn = cc.scaleTo(this._duration, 1.0);
881 
882         this._inScene.runAction(cc.sequence(this.easeActionWithAction(scaleIn), cc.callFunc(this.finish, this)));
883         this._outScene.runAction(this.easeActionWithAction(scaleOut));
884     },
885 
886     /**
887      * @param action
888      * @return {cc.EaseOut}
889      */
890     easeActionWithAction:function (action) {
891         return new cc.EaseOut(action, 2.0);
892     }
893 });
894 
895 /**
896  * Shrink the outgoing scene while grow the incoming scene
897  * @deprecated since v3.0,please use new cc.TransitionShrinkGrow(t, scene) instead.
898  * @param {Number} t time in seconds
899  * @param {cc.Scene} scene
900  * @return {cc.TransitionShrinkGrow}
901  */
902 cc.TransitionShrinkGrow.create = function (t, scene) {
903     return new cc.TransitionShrinkGrow(t, scene);
904 };
905 
906 /**
907  *  Flips the screen horizontally.<br/>
908  * The front face is the outgoing scene and the back face is the incoming scene.
909  * @class
910  * @extends cc.TransitionSceneOriented
911  * @param {Number} t time in seconds
912  * @param {cc.Scene} scene
913  * @param {cc.TRANSITION_ORIENTATION_LEFT_OVER|cc.TRANSITION_ORIENTATION_RIGHT_OVER|cc.TRANSITION_ORIENTATION_UP_OVER|cc.TRANSITION_ORIENTATION_DOWN_OVER} o
914  * @example
915  * var trans = new cc.TransitionFlipX(t,scene,o);
916  */
917 cc.TransitionFlipX = cc.TransitionSceneOriented.extend(/** @lends cc.TransitionFlipX# */{
918     /**
919      * Constructor of TransitionFlipX
920      * @function
921      * @param {Number} t time in seconds
922      * @param {cc.Scene} scene
923      * @param {cc.TRANSITION_ORIENTATION_LEFT_OVER|cc.TRANSITION_ORIENTATION_RIGHT_OVER|cc.TRANSITION_ORIENTATION_UP_OVER|cc.TRANSITION_ORIENTATION_DOWN_OVER} o
924      */
925     ctor:function (t, scene, o) {
926         cc.TransitionSceneOriented.prototype.ctor.call(this);
927         if(o == null)
928             o = cc.TRANSITION_ORIENTATION_RIGHT_OVER;
929         scene && this.initWithDuration(t, scene, o);
930     },
931 
932     /**
933      * custom on enter
934      */
935     onEnter:function () {
936         cc.TransitionScene.prototype.onEnter.call(this);
937 
938         var inA, outA;
939         this._inScene.visible = false;
940 
941         var inDeltaZ, inAngleZ, outDeltaZ, outAngleZ;
942 
943         if (this._orientation === cc.TRANSITION_ORIENTATION_RIGHT_OVER) {
944             inDeltaZ = 90;
945             inAngleZ = 270;
946             outDeltaZ = 90;
947             outAngleZ = 0;
948         } else {
949             inDeltaZ = -90;
950             inAngleZ = 90;
951             outDeltaZ = -90;
952             outAngleZ = 0;
953         }
954 
955         inA = cc.sequence(
956             cc.delayTime(this._duration / 2), cc.show(),
957             cc.orbitCamera(this._duration / 2, 1, 0, inAngleZ, inDeltaZ, 0, 0),
958             cc.callFunc(this.finish, this)
959         );
960 
961         outA = cc.sequence(
962             cc.orbitCamera(this._duration / 2, 1, 0, outAngleZ, outDeltaZ, 0, 0),
963             cc.hide(), cc.delayTime(this._duration / 2)
964         );
965 
966         this._inScene.runAction(inA);
967         this._outScene.runAction(outA);
968     }
969 });
970 
971 /**
972  * Flips the screen horizontally.<br/>
973  * The front face is the outgoing scene and the back face is the incoming scene.
974  * @deprecated since v3.0,please use new cc.TransitionFlipX(t, scene,o) instead.
975  * @param {Number} t time in seconds
976  * @param {cc.Scene} scene
977  * @param {cc.TRANSITION_ORIENTATION_LEFT_OVER|cc.TRANSITION_ORIENTATION_RIGHT_OVER|cc.TRANSITION_ORIENTATION_UP_OVER|cc.TRANSITION_ORIENTATION_DOWN_OVER} o
978  * @return {cc.TransitionFlipX}
979  */
980 cc.TransitionFlipX.create = function (t, scene, o) {
981     return new cc.TransitionFlipX(t, scene, o);
982 };
983 
984 /**
985  * Flips the screen vertically.<br/>
986  * The front face is the outgoing scene and the back face is the incoming scene.
987  * @class
988  * @extends cc.TransitionSceneOriented
989  * @param {Number} t time in seconds
990  * @param {cc.Scene} scene
991  * @param {cc.TRANSITION_ORIENTATION_LEFT_OVER|cc.TRANSITION_ORIENTATION_RIGHT_OVER|cc.TRANSITION_ORIENTATION_UP_OVER|cc.TRANSITION_ORIENTATION_DOWN_OVER} o
992  * @example
993  * var trans = new cc.TransitionFlipY(time,scene,0);
994  */
995 cc.TransitionFlipY = cc.TransitionSceneOriented.extend(/** @lends cc.TransitionFlipY# */{
996 
997     /**
998      * Constructor of TransitionFlipY
999      * @param {Number} t time in seconds
1000      * @param {cc.Scene} scene
1001      * @param {cc.TRANSITION_ORIENTATION_LEFT_OVER|cc.TRANSITION_ORIENTATION_RIGHT_OVER|cc.TRANSITION_ORIENTATION_UP_OVER|cc.TRANSITION_ORIENTATION_DOWN_OVER} o
1002      */
1003     ctor:function (t, scene, o) {
1004         cc.TransitionSceneOriented.prototype.ctor.call(this);
1005         if(o == null)
1006             o = cc.TRANSITION_ORIENTATION_UP_OVER;
1007         scene && this.initWithDuration(t, scene, o);
1008     },
1009     /**
1010      * custom on enter
1011      */
1012     onEnter:function () {
1013         cc.TransitionScene.prototype.onEnter.call(this);
1014 
1015         var inA, outA;
1016         this._inScene.visible = false;
1017 
1018         var inDeltaZ, inAngleZ, outDeltaZ, outAngleZ;
1019 
1020         if (this._orientation === cc.TRANSITION_ORIENTATION_UP_OVER) {
1021             inDeltaZ = 90;
1022             inAngleZ = 270;
1023             outDeltaZ = 90;
1024             outAngleZ = 0;
1025         } else {
1026             inDeltaZ = -90;
1027             inAngleZ = 90;
1028             outDeltaZ = -90;
1029             outAngleZ = 0;
1030         }
1031 
1032         inA = cc.sequence(
1033             cc.delayTime(this._duration / 2), cc.show(),
1034             cc.orbitCamera(this._duration / 2, 1, 0, inAngleZ, inDeltaZ, 90, 0),
1035             cc.callFunc(this.finish, this)
1036         );
1037         outA = cc.sequence(
1038             cc.orbitCamera(this._duration / 2, 1, 0, outAngleZ, outDeltaZ, 90, 0),
1039             cc.hide(), cc.delayTime(this._duration / 2)
1040         );
1041 
1042         this._inScene.runAction(inA);
1043         this._outScene.runAction(outA);
1044     }
1045 });
1046 
1047 /**
1048  * Flips the screen vertically.<br/>
1049  * The front face is the outgoing scene and the back face is the incoming scene.
1050  * @deprecated since v3.0,please use new cc.TransitionFlipY(t, scene,o) instead.
1051  * @param {Number} t time in seconds
1052  * @param {cc.Scene} scene
1053  * @param {cc.TRANSITION_ORIENTATION_LEFT_OVER|cc.TRANSITION_ORIENTATION_RIGHT_OVER|cc.TRANSITION_ORIENTATION_UP_OVER|cc.TRANSITION_ORIENTATION_DOWN_OVER} o
1054  * @return {cc.TransitionFlipY}
1055  */
1056 cc.TransitionFlipY.create = function (t, scene, o) {
1057     return new cc.TransitionFlipY(t, scene, o);
1058 };
1059 
1060 /**
1061  * Flips the screen half horizontally and half vertically.<br/>
1062  * The front face is the outgoing scene and the back face is the incoming scene.
1063  * @class
1064  * @extends cc.TransitionSceneOriented
1065  * @param {Number} t time in seconds
1066  * @param {cc.Scene} scene
1067  * @param {cc.TRANSITION_ORIENTATION_LEFT_OVER|cc.TRANSITION_ORIENTATION_RIGHT_OVER|cc.TRANSITION_ORIENTATION_UP_OVER|cc.TRANSITION_ORIENTATION_DOWN_OVER} o
1068  * @example
1069  * var trans = cc.TransitionFlipAngular(time,scene,o);
1070  */
1071 cc.TransitionFlipAngular = cc.TransitionSceneOriented.extend(/** @lends cc.TransitionFlipAngular# */{
1072     /**
1073      * Constructor of TransitionFlipAngular
1074      * @param {Number} t time in seconds
1075      * @param {cc.Scene} scene
1076      * @param {cc.TRANSITION_ORIENTATION_LEFT_OVER|cc.TRANSITION_ORIENTATION_RIGHT_OVER|cc.TRANSITION_ORIENTATION_UP_OVER|cc.TRANSITION_ORIENTATION_DOWN_OVER} o
1077      */
1078     ctor:function (t, scene, o) {
1079         cc.TransitionSceneOriented.prototype.ctor.call(this);
1080         if(o == null)
1081             o = cc.TRANSITION_ORIENTATION_RIGHT_OVER;
1082         scene && this.initWithDuration(t, scene, o);
1083     },
1084     /**
1085      * custom on enter
1086      */
1087     onEnter:function () {
1088         cc.TransitionScene.prototype.onEnter.call(this);
1089 
1090         var inA, outA;
1091         this._inScene.visible = false;
1092 
1093         var inDeltaZ, inAngleZ, outDeltaZ, outAngleZ;
1094 
1095         if (this._orientation === cc.TRANSITION_ORIENTATION_RIGHT_OVER) {
1096             inDeltaZ = 90;
1097             inAngleZ = 270;
1098             outDeltaZ = 90;
1099             outAngleZ = 0;
1100         } else {
1101             inDeltaZ = -90;
1102             inAngleZ = 90;
1103             outDeltaZ = -90;
1104             outAngleZ = 0;
1105         }
1106 
1107         inA = cc.sequence(
1108             cc.delayTime(this._duration / 2), cc.show(),
1109             cc.orbitCamera(this._duration / 2, 1, 0, inAngleZ, inDeltaZ, -45, 0),
1110             cc.callFunc(this.finish, this)
1111         );
1112         outA = cc.sequence(
1113             cc.orbitCamera(this._duration / 2, 1, 0, outAngleZ, outDeltaZ, 45, 0),
1114             cc.hide(), cc.delayTime(this._duration / 2)
1115         );
1116 
1117         this._inScene.runAction(inA);
1118         this._outScene.runAction(outA);
1119     }
1120 });
1121 
1122 /**
1123  * Flips the screen half horizontally and half vertically.<br/>
1124  * The front face is the outgoing scene and the back face is the incoming scene.
1125  * @deprecated since v3.0,please use new new cc.TransitionFlipAngular(t, scene, o) instead
1126  * @param {Number} t time in seconds
1127  * @param {cc.Scene} scene
1128  * @param {cc.TRANSITION_ORIENTATION_LEFT_OVER|cc.TRANSITION_ORIENTATION_RIGHT_OVER|cc.TRANSITION_ORIENTATION_UP_OVER|cc.TRANSITION_ORIENTATION_DOWN_OVER} o
1129  * @return {cc.TransitionFlipAngular}
1130  */
1131 cc.TransitionFlipAngular.create = function (t, scene, o) {
1132     return new cc.TransitionFlipAngular(t, scene, o);
1133 };
1134 
1135 /**
1136  *  Flips the screen horizontally doing a zoom out/in<br/>
1137  * The front face is the outgoing scene and the back face is the incoming scene.
1138  * @class
1139  * @extends cc.TransitionSceneOriented
1140  * @param {Number} t time in seconds
1141  * @param {cc.Scene} scene
1142  * @param {cc.TRANSITION_ORIENTATION_LEFT_OVER|cc.TRANSITION_ORIENTATION_RIGHT_OVER|cc.TRANSITION_ORIENTATION_UP_OVER|cc.TRANSITION_ORIENTATION_DOWN_OVER} o
1143  * @example
1144  * var trans = new cc.TransitionZoomFlipX(time,scene,o);
1145  */
1146 cc.TransitionZoomFlipX = cc.TransitionSceneOriented.extend(/** @lends cc.TransitionZoomFlipX# */{
1147 
1148     /**
1149      * Constructor of TransitionZoomFlipX
1150      * @param {Number} t time in seconds
1151      * @param {cc.Scene} scene
1152      * @param {cc.TRANSITION_ORIENTATION_LEFT_OVER|cc.TRANSITION_ORIENTATION_RIGHT_OVER|cc.TRANSITION_ORIENTATION_UP_OVER|cc.TRANSITION_ORIENTATION_DOWN_OVER} o
1153      */
1154     ctor:function (t, scene, o) {
1155         cc.TransitionSceneOriented.prototype.ctor.call(this);
1156         if(o == null)
1157             o = cc.TRANSITION_ORIENTATION_RIGHT_OVER;
1158         scene && this.initWithDuration(t, scene, o);
1159     },
1160     /**
1161      * custom on enter
1162      */
1163     onEnter:function () {
1164         cc.TransitionScene.prototype.onEnter.call(this);
1165 
1166         var inA, outA;
1167         this._inScene.visible = false;
1168 
1169         var inDeltaZ, inAngleZ, outDeltaZ, outAngleZ;
1170 
1171         if (this._orientation === cc.TRANSITION_ORIENTATION_RIGHT_OVER) {
1172             inDeltaZ = 90;
1173             inAngleZ = 270;
1174             outDeltaZ = 90;
1175             outAngleZ = 0;
1176         } else {
1177             inDeltaZ = -90;
1178             inAngleZ = 90;
1179             outDeltaZ = -90;
1180             outAngleZ = 0;
1181         }
1182 
1183         inA = cc.sequence(
1184             cc.delayTime(this._duration / 2),
1185             cc.spawn(
1186                 cc.orbitCamera(this._duration / 2, 1, 0, inAngleZ, inDeltaZ, 0, 0),
1187                 cc.scaleTo(this._duration / 2, 1), cc.show()),
1188             cc.callFunc(this.finish, this)
1189         );
1190         outA = cc.sequence(
1191             cc.spawn(
1192                 cc.orbitCamera(this._duration / 2, 1, 0, outAngleZ, outDeltaZ, 0, 0),
1193                 cc.scaleTo(this._duration / 2, 0.5)),
1194             cc.hide(),
1195             cc.delayTime(this._duration / 2)
1196         );
1197 
1198         this._inScene.scale = 0.5;
1199         this._inScene.runAction(inA);
1200         this._outScene.runAction(outA);
1201     }
1202 });
1203 
1204 /**
1205  * Flips the screen horizontally doing a zoom out/in<br/>
1206  * The front face is the outgoing scene and the back face is the incoming scene.
1207  * @deprecated since v3.0,please use new new cc.TransitionZoomFlipX(t, scene, o) instead
1208  * @param {Number} t time in seconds
1209  * @param {cc.Scene} scene
1210  * @param {cc.TRANSITION_ORIENTATION_LEFT_OVER|cc.TRANSITION_ORIENTATION_RIGHT_OVER|cc.TRANSITION_ORIENTATION_UP_OVER|cc.TRANSITION_ORIENTATION_DOWN_OVER} o
1211  * @return {cc.TransitionZoomFlipX}
1212  */
1213 cc.TransitionZoomFlipX.create = function (t, scene, o) {
1214     return new cc.TransitionZoomFlipX(t, scene, o);
1215 };
1216 
1217 /**
1218  * Flips the screen vertically doing a little zooming out/in<br/>
1219  * The front face is the outgoing scene and the back face is the incoming scene.
1220  * @class
1221  * @extends cc.TransitionSceneOriented
1222  * @param {Number} t time in seconds
1223  * @param {cc.Scene} scene
1224  * @param {cc.TRANSITION_ORIENTATION_LEFT_OVER|cc.TRANSITION_ORIENTATION_RIGHT_OVER|cc.TRANSITION_ORIENTATION_UP_OVER|cc.TRANSITION_ORIENTATION_DOWN_OVER} o
1225  * @example
1226  * var trans = new cc.TransitionZoomFlipY(t,scene,o);
1227  */
1228 cc.TransitionZoomFlipY = cc.TransitionSceneOriented.extend(/** @lends cc.TransitionZoomFlipY# */{
1229 
1230     /**
1231      * Constructor of TransitionZoomFlipY
1232      * @param {Number} t time in seconds
1233      * @param {cc.Scene} scene
1234      * @param {cc.TRANSITION_ORIENTATION_LEFT_OVER|cc.TRANSITION_ORIENTATION_RIGHT_OVER|cc.TRANSITION_ORIENTATION_UP_OVER|cc.TRANSITION_ORIENTATION_DOWN_OVER} o
1235      */
1236     ctor:function (t, scene, o) {
1237         cc.TransitionSceneOriented.prototype.ctor.call(this);
1238         if(o == null)
1239             o = cc.TRANSITION_ORIENTATION_UP_OVER;
1240         scene && this.initWithDuration(t, scene, o);
1241     },
1242     /**
1243      * custom on enter
1244      */
1245     onEnter:function () {
1246         cc.TransitionScene.prototype.onEnter.call(this);
1247 
1248         var inA, outA;
1249         this._inScene.visible = false;
1250 
1251         var inDeltaZ, inAngleZ, outDeltaZ, outAngleZ;
1252 
1253         if (this._orientation === cc.TRANSITION_ORIENTATION_UP_OVER) {
1254             inDeltaZ = 90;
1255             inAngleZ = 270;
1256             outDeltaZ = 90;
1257             outAngleZ = 0;
1258         } else {
1259             inDeltaZ = -90;
1260             inAngleZ = 90;
1261             outDeltaZ = -90;
1262             outAngleZ = 0;
1263         }
1264 
1265         inA = cc.sequence(
1266             cc.delayTime(this._duration / 2),
1267             cc.spawn(
1268                 cc.orbitCamera(this._duration / 2, 1, 0, inAngleZ, inDeltaZ, 90, 0),
1269                 cc.scaleTo(this._duration / 2, 1), cc.show()),
1270             cc.callFunc(this.finish, this));
1271 
1272         outA = cc.sequence(
1273             cc.spawn(
1274                 cc.orbitCamera(this._duration / 2, 1, 0, outAngleZ, outDeltaZ, 90, 0),
1275                 cc.scaleTo(this._duration / 2, 0.5)),
1276             cc.hide(), cc.delayTime(this._duration / 2));
1277 
1278         this._inScene.scale = 0.5;
1279         this._inScene.runAction(inA);
1280         this._outScene.runAction(outA);
1281     }
1282 });
1283 
1284 /**
1285  * Flips the screen vertically doing a little zooming out/in<br/>
1286  * The front face is the outgoing scene and the back face is the incoming scene.
1287  * @deprecated since v3.0,please use new new cc.TransitionZoomFlipY(t, scene, o) instead
1288  * @param {Number} t time in seconds
1289  * @param {cc.Scene} scene
1290  * @param {cc.TRANSITION_ORIENTATION_LEFT_OVER|cc.TRANSITION_ORIENTATION_RIGHT_OVER|cc.TRANSITION_ORIENTATION_UP_OVER|cc.TRANSITION_ORIENTATION_DOWN_OVER} o
1291  * @return {cc.TransitionZoomFlipY}
1292  */
1293 cc.TransitionZoomFlipY.create = function (t, scene, o) {
1294     return new cc.TransitionZoomFlipY(t, scene, o);
1295 };
1296 
1297 /**
1298  *  Flips the screen half horizontally and half vertically doing a little zooming out/in.<br/>
1299  * The front face is the outgoing scene and the back face is the incoming scene.
1300  * @class
1301  * @extends cc.TransitionSceneOriented
1302  * @param {Number} t time in seconds
1303  * @param {cc.Scene} scene
1304  * @param {cc.TRANSITION_ORIENTATION_LEFT_OVER|cc.TRANSITION_ORIENTATION_RIGHT_OVER|cc.TRANSITION_ORIENTATION_UP_OVER|cc.TRANSITION_ORIENTATION_DOWN_OVER} o
1305  * @example
1306  * var trans = new cc.TransitionZoomFlipAngular(time,scene,o);
1307  */
1308 cc.TransitionZoomFlipAngular = cc.TransitionSceneOriented.extend(/** @lends cc.TransitionZoomFlipAngular# */{
1309 
1310     /**
1311      * Constructor of TransitionZoomFlipAngular
1312      * @param {Number} t time in seconds
1313      * @param {cc.Scene} scene
1314      * @param {cc.TRANSITION_ORIENTATION_LEFT_OVER|cc.TRANSITION_ORIENTATION_RIGHT_OVER|cc.TRANSITION_ORIENTATION_UP_OVER|cc.TRANSITION_ORIENTATION_DOWN_OVER} o
1315      */
1316     ctor:function (t, scene, o) {
1317         cc.TransitionSceneOriented.prototype.ctor.call(this);
1318         if(o == null)
1319             o = cc.TRANSITION_ORIENTATION_RIGHT_OVER;
1320         scene && this.initWithDuration(t, scene, o);
1321     },
1322     /**
1323      * custom on enter
1324      */
1325     onEnter:function () {
1326         cc.TransitionScene.prototype.onEnter.call(this);
1327 
1328         var inA, outA;
1329         this._inScene.visible = false;
1330 
1331         var inDeltaZ, inAngleZ, outDeltaZ, outAngleZ;
1332         if (this._orientation === cc.TRANSITION_ORIENTATION_RIGHT_OVER) {
1333             inDeltaZ = 90;
1334             inAngleZ = 270;
1335             outDeltaZ = 90;
1336             outAngleZ = 0;
1337         } else {
1338             inDeltaZ = -90;
1339             inAngleZ = 90;
1340             outDeltaZ = -90;
1341             outAngleZ = 0;
1342         }
1343 
1344         inA = cc.sequence(
1345             cc.delayTime(this._duration / 2),
1346             cc.spawn(
1347                 cc.orbitCamera(this._duration / 2, 1, 0, inAngleZ, inDeltaZ, -45, 0),
1348                 cc.scaleTo(this._duration / 2, 1), cc.show()),
1349             cc.show(),
1350             cc.callFunc(this.finish, this));
1351         outA = cc.sequence(
1352             cc.spawn(
1353                 cc.orbitCamera(this._duration / 2, 1, 0, outAngleZ, outDeltaZ, 45, 0),
1354                 cc.scaleTo(this._duration / 2, 0.5)),
1355             cc.hide(), cc.delayTime(this._duration / 2));
1356 
1357         this._inScene.scale = 0.5;
1358         this._inScene.runAction(inA);
1359         this._outScene.runAction(outA);
1360     }
1361 });
1362 
1363 /**
1364  *  Flips the screen half horizontally and half vertically doing a little zooming out/in.<br/>
1365  * The front face is the outgoing scene and the back face is the incoming scene.
1366  * @deprecated since v3.0,please use new new cc.TransitionZoomFlipAngular(t, scene, o) instead
1367  * @param {Number} t time in seconds
1368  * @param {cc.Scene} scene
1369  * @param {cc.TRANSITION_ORIENTATION_LEFT_OVER|cc.TRANSITION_ORIENTATION_RIGHT_OVER|cc.TRANSITION_ORIENTATION_UP_OVER|cc.TRANSITION_ORIENTATION_DOWN_OVER} o
1370  * @return {cc.TransitionZoomFlipAngular}
1371  */
1372 cc.TransitionZoomFlipAngular.create = function (t, scene, o) {
1373     return new cc.TransitionZoomFlipAngular(t, scene, o);
1374 };
1375 
1376 /**
1377  * Fade out the outgoing scene and then fade in the incoming scene.
1378  * @class
1379  * @extends cc.TransitionScene
1380  * @param {Number} t time in seconds
1381  * @param {cc.Scene} scene
1382  * @param {cc.TRANSITION_ORIENTATION_LEFT_OVER|cc.TRANSITION_ORIENTATION_RIGHT_OVER|cc.TRANSITION_ORIENTATION_UP_OVER|cc.TRANSITION_ORIENTATION_DOWN_OVER} o
1383  * @example
1384  * var trans = new cc.TransitionFade(time,scene,color)
1385  */
1386 cc.TransitionFade = cc.TransitionScene.extend(/** @lends cc.TransitionFade# */{
1387     _color:null,
1388 
1389     /**
1390      * Constructor of TransitionFade
1391      * @param {Number} t time in seconds
1392      * @param {cc.Scene} scene
1393      * @param {cc.TRANSITION_ORIENTATION_LEFT_OVER|cc.TRANSITION_ORIENTATION_RIGHT_OVER|cc.TRANSITION_ORIENTATION_UP_OVER|cc.TRANSITION_ORIENTATION_DOWN_OVER} o
1394      */
1395     ctor:function (t, scene, color) {
1396         cc.TransitionScene.prototype.ctor.call(this);
1397         this._color = cc.color();
1398         scene && this.initWithDuration(t, scene, color);
1399     },
1400 
1401     /**
1402      * custom on enter
1403      */
1404     onEnter:function () {
1405         cc.TransitionScene.prototype.onEnter.call(this);
1406 
1407         var l = new cc.LayerColor(this._color);
1408         this._inScene.visible = false;
1409 
1410         this.addChild(l, 2, cc.SCENE_FADE);
1411         var f = this.getChildByTag(cc.SCENE_FADE);
1412 
1413         var a = cc.sequence(
1414             cc.fadeIn(this._duration / 2),
1415             cc.callFunc(this.hideOutShowIn, this),
1416             cc.fadeOut(this._duration / 2),
1417             cc.callFunc(this.finish, this)
1418         );
1419         f.runAction(a);
1420     },
1421 
1422     /**
1423      * custom on exit
1424      */
1425     onExit:function () {
1426         cc.TransitionScene.prototype.onExit.call(this);
1427         this.removeChildByTag(cc.SCENE_FADE, false);
1428     },
1429 
1430     /**
1431      * initializes the transition with a duration and with an RGB color
1432      * @param {Number} t time in seconds
1433      * @param {cc.Scene} scene
1434      * @param {cc.Color} color
1435      * @return {Boolean}
1436      */
1437     initWithDuration:function (t, scene, color) {
1438         color = color || cc.color.BLACK;
1439         if (cc.TransitionScene.prototype.initWithDuration.call(this, t, scene)) {
1440             this._color.r = color.r;
1441             this._color.g = color.g;
1442             this._color.b = color.b;
1443             this._color.a = 0;
1444         }
1445         return true;
1446     }
1447 });
1448 
1449 
1450 /**
1451  * Fade out the outgoing scene and then fade in the incoming scene.
1452  * @deprecated since v3.0,please use new cc.TransitionFade(time,scene,color) instead.
1453  * @param {Number} t time in seconds
1454  * @param {cc.Scene} scene
1455  * @param {cc.Color} color
1456  * @return {cc.TransitionFade}
1457  */
1458 cc.TransitionFade.create = function (t, scene, color) {
1459     return new cc.TransitionFade(t, scene, color);
1460 };
1461 
1462 /**
1463  * Cross fades two scenes using the cc.RenderTexture object.
1464  * @class
1465  * @extends cc.TransitionScene
1466  * @param {Number} t time in seconds
1467  * @param {cc.Scene} scene
1468  * @example
1469  * var trans = new cc.TransitionCrossFade(time,scene);
1470  */
1471 cc.TransitionCrossFade = cc.TransitionScene.extend(/** @lends cc.TransitionCrossFade# */{
1472     /**
1473      * Constructor of TransitionCrossFade
1474      * @param {Number} t time in seconds
1475      * @param {cc.Scene} scene
1476      */
1477     ctor:function (t, scene) {
1478         cc.TransitionScene.prototype.ctor.call(this);
1479         scene && this.initWithDuration(t, scene);
1480     },
1481     /**
1482      * custom on enter
1483      */
1484     onEnter:function () {
1485         cc.TransitionScene.prototype.onEnter.call(this);
1486 
1487         // create a transparent color layer
1488         // in which we are going to add our rendertextures
1489         var color = cc.color(0, 0, 0, 0);
1490         var winSize = cc.director.getWinSize();
1491         var layer = new cc.LayerColor(color);
1492 
1493         // create the first render texture for inScene
1494         var inTexture = new cc.RenderTexture(winSize.width, winSize.height);
1495 
1496         inTexture.sprite.anchorX = 0.5;
1497 	    inTexture.sprite.anchorY = 0.5;
1498         inTexture.attr({
1499 	        x: winSize.width / 2,
1500 	        y: winSize.height / 2,
1501 	        anchorX: 0.5,
1502 	        anchorY: 0.5
1503         });
1504 
1505         // render inScene to its texturebuffer
1506         inTexture.begin();
1507         this._inScene.visit();
1508         inTexture.end();
1509 
1510         // create the second render texture for outScene
1511         var outTexture = new cc.RenderTexture(winSize.width, winSize.height);
1512         outTexture.setPosition(winSize.width / 2, winSize.height / 2);
1513 	    outTexture.sprite.anchorX = outTexture.anchorX = 0.5;
1514 	    outTexture.sprite.anchorY = outTexture.anchorY = 0.5;
1515 
1516         // render outScene to its texturebuffer
1517         outTexture.begin();
1518         this._outScene.visit();
1519         outTexture.end();
1520 
1521         inTexture.sprite.setBlendFunc(cc.ONE, cc.ONE);                                             // inScene will lay on background and will not be used with alpha
1522         outTexture.sprite.setBlendFunc(cc.SRC_ALPHA, cc.ONE_MINUS_SRC_ALPHA);                      // we are going to blend outScene via alpha
1523 
1524         // add render textures to the layer
1525         layer.addChild(inTexture);
1526         layer.addChild(outTexture);
1527 
1528         // initial opacity:
1529         inTexture.sprite.opacity = 255;
1530         outTexture.sprite.opacity = 255;
1531 
1532         // create the blend action
1533         var layerAction = cc.sequence(
1534             cc.fadeTo(this._duration, 0), cc.callFunc(this.hideOutShowIn, this),
1535             cc.callFunc(this.finish, this)
1536         );
1537 
1538         // run the blend action
1539         outTexture.sprite.runAction(layerAction);
1540 
1541         // add the layer (which contains our two rendertextures) to the scene
1542         this.addChild(layer, 2, cc.SCENE_FADE);
1543     },
1544 
1545     /**
1546      * custom on exit
1547      */
1548     onExit:function () {
1549         this.removeChildByTag(cc.SCENE_FADE, false);
1550         cc.TransitionScene.prototype.onExit.call(this);
1551     },
1552 
1553     /**
1554      * stuff gets drawn here
1555      */
1556     visit:function () {
1557         cc.Node.prototype.visit.call(this);
1558     },
1559 
1560     /**
1561      * overide draw
1562      */
1563     draw:function () {
1564         // override draw since both scenes (textures) are rendered in 1 scene
1565     }
1566 });
1567 
1568 /**
1569  * Cross fades two scenes using the cc.RenderTexture object.
1570  * @deprecated since v3.0,please use new cc.TransitionCrossFade(t, scene) instead.
1571  * @param {Number} t time in seconds
1572  * @param {cc.Scene} scene
1573  * @return {cc.TransitionCrossFade}
1574  */
1575 cc.TransitionCrossFade.create = function (t, scene) {
1576     return new cc.TransitionCrossFade(t, scene);
1577 };
1578 
1579 /**
1580  *  Turn off the tiles of the outgoing scene in random order
1581  * @class
1582  * @extends cc.TransitionScene
1583  * @param {Number} t time in seconds
1584  * @param {cc.Scene} scene
1585  * @example
1586  * var trans = new cc.TransitionTurnOffTiles(time,scene);
1587  */
1588 cc.TransitionTurnOffTiles = cc.TransitionScene.extend(/** @lends cc.TransitionTurnOffTiles# */{
1589     _gridProxy: null,
1590     /**
1591      * Constructor of TransitionCrossFade
1592      * @param {Number} t time in seconds
1593      * @param {cc.Scene} scene
1594      */
1595     ctor:function (t, scene) {
1596         cc.TransitionScene.prototype.ctor.call(this);
1597         this._gridProxy = new cc.NodeGrid();
1598         scene && this.initWithDuration(t, scene);
1599     },
1600 
1601     _sceneOrder:function () {
1602         this._isInSceneOnTop = false;
1603     },
1604 
1605     /**
1606      * custom on enter
1607      */
1608     onEnter:function () {
1609         cc.TransitionScene.prototype.onEnter.call(this);
1610         this._gridProxy.setTarget(this._outScene);
1611         this._gridProxy.onEnter();
1612 
1613         var winSize = cc.director.getWinSize();
1614         var aspect = winSize.width / winSize.height;
1615         var x = 0 | (12 * aspect);
1616         var y = 12;
1617         var toff = cc.turnOffTiles(this._duration, cc.size(x, y));
1618         var action = this.easeActionWithAction(toff);
1619         this._gridProxy.runAction(cc.sequence(action, cc.callFunc(this.finish, this), cc.stopGrid()));
1620     },
1621 
1622     visit: function(){
1623         this._inScene.visit();
1624         this._gridProxy.visit();
1625     },
1626 
1627     /**
1628      * @param {cc.ActionInterval} action
1629      * @return {cc.ActionInterval}
1630      */
1631     easeActionWithAction:function (action) {
1632         return action;
1633     }
1634 });
1635 
1636 /**
1637  *  Turn off the tiles of the outgoing scene in random order
1638  * @deprecated since v3.0,please use new cc.TransitionTurnOffTiles(t, scene) instead.
1639  * @param {Number} t time in seconds
1640  * @param {cc.Scene} scene
1641  * @return {cc.TransitionTurnOffTiles}
1642  */
1643 cc.TransitionTurnOffTiles.create = function (t, scene) {
1644     return new cc.TransitionTurnOffTiles(t, scene);
1645 };
1646 
1647 /**
1648  *  The odd columns goes upwards while the even columns goes downwards.
1649  * @class
1650  * @extends cc.TransitionScene
1651  * @param {Number} t time in seconds
1652  * @param {cc.Scene} scene
1653  * @example
1654  * var trans = new cc.TransitionSplitCols(time,scene);
1655  */
1656 cc.TransitionSplitCols = cc.TransitionScene.extend(/** @lends cc.TransitionSplitCols# */{
1657     _gridProxy: null,
1658 
1659     _switchTargetToInscene: function(){
1660         this._gridProxy.setTarget(this._inScene);
1661     },
1662 
1663     /**
1664      * Constructor of TransitionSplitCols
1665      * @param {Number} t time in seconds
1666      * @param {cc.Scene} scene
1667      */
1668     ctor:function (t, scene) {
1669         cc.TransitionScene.prototype.ctor.call(this);
1670         this._gridProxy = new cc.NodeGrid();
1671         scene && this.initWithDuration(t, scene);
1672     },
1673     /**
1674      * custom on enter
1675      */
1676     onEnter:function () {
1677         cc.TransitionScene.prototype.onEnter.call(this);
1678         //this._inScene.visible = false;
1679         this._gridProxy.setTarget(this._outScene);
1680         this._gridProxy.onEnter();
1681 
1682         var split = this.action();
1683         var seq = cc.sequence(
1684             split, cc.callFunc(this._switchTargetToInscene, this), split.reverse());
1685 
1686         this._gridProxy.runAction(
1687             cc.sequence(this.easeActionWithAction(seq), cc.callFunc(this.finish, this), cc.stopGrid())
1688         );
1689     },
1690 
1691     onExit: function(){
1692         this._gridProxy.setTarget(null);
1693         this._gridProxy.onExit();
1694         cc.TransitionScene.prototype.onExit.call(this);
1695     },
1696 
1697     visit: function(){
1698         this._gridProxy.visit();
1699     },
1700 
1701     /**
1702      * @param {cc.ActionInterval} action
1703      * @return {cc.EaseInOut}
1704      */
1705     easeActionWithAction:function (action) {
1706         return new cc.EaseInOut(action, 3.0);
1707     },
1708 
1709     /**
1710      * @return {*}
1711      */
1712     action:function () {
1713         return cc.splitCols(this._duration / 2.0, 3);
1714     }
1715 });
1716 
1717 /**
1718  * The odd columns goes upwards while the even columns goes downwards.
1719  * @deprecated since v3.0,please use new cc.TransitionSplitCols(t, scene) instead.
1720  * @param {Number} t time in seconds
1721  * @param {cc.Scene} scene
1722  * @return {cc.TransitionSplitCols}
1723  */
1724 cc.TransitionSplitCols.create = function (t, scene) {
1725     return new cc.TransitionSplitCols(t, scene);
1726 };
1727 
1728 /**
1729  *  The odd rows goes to the left while the even rows goes to the right.
1730  * @class
1731  * @extends cc.TransitionSplitCols
1732  * @param {Number} t time in seconds
1733  * @param {cc.Scene} scene
1734  * @example
1735  * var trans = new cc.TransitionSplitRows(time,scene);
1736  */
1737 cc.TransitionSplitRows = cc.TransitionSplitCols.extend(/** @lends cc.TransitionSplitRows# */{
1738 
1739     /**
1740      * Constructor of TransitionSplitRows
1741      * @param {Number} t time in seconds
1742      * @param {cc.Scene} scene
1743      */
1744     ctor:function (t, scene) {
1745         cc.TransitionSplitCols.prototype.ctor.call(this);
1746         scene && this.initWithDuration(t, scene);
1747     },
1748     /**
1749      * @return {*}
1750      */
1751     action:function () {
1752         return cc.splitRows(this._duration / 2.0, 3);
1753     }
1754 });
1755 
1756 /**
1757  * The odd rows goes to the left while the even rows goes to the right.
1758  * @deprecated since v3.0,please use new cc.TransitionSplitRows(t, scene) instead.
1759  * @param {Number} t time in seconds
1760  * @param {cc.Scene} scene
1761  * @return {cc.TransitionSplitRows}
1762  */
1763 cc.TransitionSplitRows.create = function (t, scene) {
1764     return new cc.TransitionSplitRows(t, scene);
1765 };
1766 
1767 /**
1768  *  Fade the tiles of the outgoing scene from the left-bottom corner the to top-right corner.
1769  * @class
1770  * @extends cc.TransitionScene
1771  * @param {Number} t time in seconds
1772  * @param {cc.Scene} scene
1773  * @example
1774  * var trans = new cc.TransitionFadeTR(time,scene);
1775  */
1776 cc.TransitionFadeTR = cc.TransitionScene.extend(/** @lends cc.TransitionFadeTR# */{
1777     _gridProxy: null,
1778     /**
1779      * Constructor of TransitionFadeTR
1780      * @param {Number} t time in seconds
1781      * @param {cc.Scene} scene
1782      */
1783     ctor:function (t, scene) {
1784         cc.TransitionScene.prototype.ctor.call(this);
1785         this._gridProxy = new cc.NodeGrid();
1786         scene && this.initWithDuration(t, scene);
1787     },
1788     _sceneOrder:function () {
1789         this._isInSceneOnTop = false;
1790     },
1791 
1792     /**
1793      * Custom on enter
1794      */
1795     onEnter:function () {
1796         cc.TransitionScene.prototype.onEnter.call(this);
1797 
1798         this._gridProxy.setTarget(this._outScene);
1799         this._gridProxy.onEnter();
1800 
1801         var winSize = cc.director.getWinSize();
1802         var aspect = winSize.width / winSize.height;
1803         var x = 0 | (12 * aspect);
1804         var y = 12;
1805 
1806         var action = this.actionWithSize(cc.size(x, y));
1807         this._gridProxy.runAction(
1808             cc.sequence(this.easeActionWithAction(action), cc.callFunc(this.finish, this), cc.stopGrid())
1809         );
1810     },
1811 
1812     visit: function(){
1813         this._inScene.visit();
1814         this._gridProxy.visit();
1815     },
1816 
1817     /**
1818      * @param {cc.ActionInterval} action
1819      * @return {cc.ActionInterval}
1820      */
1821     easeActionWithAction:function (action) {
1822         return action;
1823     },
1824 
1825     /**
1826      * @param {cc.Size} size
1827      * @return {*}
1828      */
1829     actionWithSize:function (size) {
1830         return cc.fadeOutTRTiles(this._duration, size);
1831     }
1832 });
1833 
1834 /**
1835  *  Fade the tiles of the outgoing scene from the left-bottom corner the to top-right corner.
1836  * @deprecated since v3.0 please use new cc.TransitionFadeTR(t, scene) instead.
1837  * @param {Number} t time in seconds
1838  * @param {cc.Scene} scene
1839  * @return {cc.TransitionFadeTR}
1840  */
1841 cc.TransitionFadeTR.create = function (t, scene) {
1842     return new cc.TransitionFadeTR(t, scene);
1843 };
1844 
1845 /**
1846  *  Fade the tiles of the outgoing scene from the top-right corner to the bottom-left corner.
1847  * @class
1848  * @extends cc.TransitionFadeTR
1849  * @param {Number} t time in seconds
1850  * @param {cc.Scene} scene
1851  * @example
1852  * var trans = new cc.TransitionFadeBL(time,scene)
1853  */
1854 cc.TransitionFadeBL = cc.TransitionFadeTR.extend(/** @lends cc.TransitionFadeBL# */{
1855     /**
1856      * Constructor of TransitionFadeBL
1857      * @param {Number} t time in seconds
1858      * @param {cc.Scene} scene
1859      */
1860     ctor:function (t, scene) {
1861         cc.TransitionFadeTR.prototype.ctor.call(this);
1862         scene && this.initWithDuration(t, scene);
1863     },
1864 
1865     /**
1866      * @param {cc.Size} size
1867      * @return {*}
1868      */
1869     actionWithSize:function (size) {
1870         return cc.fadeOutBLTiles(this._duration, size);
1871     }
1872 });
1873 
1874 /**
1875  * Fade the tiles of the outgoing scene from the top-right corner to the bottom-left corner.
1876  * @deprecated since v3.0,please use new cc.TransitionFadeBL(t, scene);
1877  * @param {Number} t time in seconds
1878  * @param {cc.Scene} scene
1879  * @return {cc.TransitionFadeBL}
1880  */
1881 cc.TransitionFadeBL.create = function (t, scene) {
1882     return new cc.TransitionFadeBL(t, scene);
1883 };
1884 
1885 /**
1886  * Fade the tiles of the outgoing scene from the top-right corner to the bottom-left corner.
1887  * @class
1888  * @extends cc.TransitionFadeTR
1889  * @param {Number} t time in seconds
1890  * @param {cc.Scene} scene
1891  * @example
1892  * var trans = new cc.TransitionFadeUp(time,scene);
1893  */
1894 cc.TransitionFadeUp = cc.TransitionFadeTR.extend(/** @lends cc.TransitionFadeUp# */{
1895 
1896     /**
1897      * Constructor of TransitionFadeUp
1898      * @function
1899      * @param {Number} t time in seconds
1900      * @param {cc.Scene} scene
1901      */
1902     ctor:function (t, scene) {
1903         cc.TransitionFadeTR.prototype.ctor.call(this);
1904         scene && this.initWithDuration(t, scene);
1905     },
1906 
1907     /**
1908      * @param {cc.Size} size
1909      * @return {cc.FadeOutUpTiles}
1910      */
1911     actionWithSize:function (size) {
1912         return new cc.FadeOutUpTiles(this._duration, size);
1913     }
1914 });
1915 
1916 /**
1917  * Fade the tiles of the outgoing scene from the top-right corner to the bottom-left corner.
1918  * @deprecated since v3.0,please use new cc.TransitionFadeUp(t, scene) instead.
1919  * @param {Number} t time in seconds
1920  * @param {cc.Scene} scene
1921  * @return {cc.TransitionFadeUp}
1922  */
1923 cc.TransitionFadeUp.create = function (t, scene) {
1924     return new cc.TransitionFadeUp(t, scene);
1925 };
1926 
1927 /**
1928  * Fade the tiles of the outgoing scene from the top to the bottom.
1929  * @class
1930  * @extends cc.TransitionFadeTR
1931  * @param {Number} t time in seconds
1932  * @param {cc.Scene} scene
1933  * @example
1934  * var trans = new cc.TransitionFadeDown(time,scene);
1935  */
1936 cc.TransitionFadeDown = cc.TransitionFadeTR.extend(/** @lends cc.TransitionFadeDown# */{
1937 
1938     /**
1939      * Constructor of TransitionFadeDown
1940      * @param {Number} t time in seconds
1941      * @param {cc.Scene} scene
1942      */
1943     ctor:function (t, scene) {
1944         cc.TransitionFadeTR.prototype.ctor.call(this);
1945         scene && this.initWithDuration(t, scene);
1946     },
1947 
1948     /**
1949      * @param {cc.Size} size
1950      * @return {*}
1951      */
1952     actionWithSize:function (size) {
1953         return cc.fadeOutDownTiles( this._duration, size);
1954     }
1955 });
1956 
1957 /**
1958  * Fade the tiles of the outgoing scene from the top to the bottom.
1959  * @deprecated since v3.0,please use new cc.TransitionFadeDown(t, scene) instead.
1960  * @param {Number} t time in seconds
1961  * @param {cc.Scene} scene
1962  * @return {cc.TransitionFadeDown}
1963  */
1964 cc.TransitionFadeDown.create = function (t, scene) {
1965     return new cc.TransitionFadeDown(t, scene);
1966 };
1967