diff --git a/CCDebugger.js b/CCDebugger.js index bbfc344158..a9015122eb 100644 --- a/CCDebugger.js +++ b/CCDebugger.js @@ -367,6 +367,8 @@ cc.DebugMode = Enum({ * @module cc */ +var jsbLog = cc.log || console.log; + /** * Init Debug setting. * @method _initDebugSetting @@ -380,7 +382,7 @@ cc._initDebugSetting = function (mode) { return; var locLog; - if(mode > cc.DebugMode.ERROR){ + if (!CC_JSB && mode > cc.DebugMode.ERROR) { //log to web page locLog = cc._logToWebPage.bind(cc); cc.error = function(){ @@ -471,7 +473,10 @@ cc._initDebugSetting = function (mode) { * @param {any} obj - A JavaScript string containing zero or more substitution strings. * @param {any} ...subst - JavaScript objects with which to replace substitution strings within msg. This gives you additional control over the format of the output. */ - if (console.log.bind) { + if (CC_JSB) { + cc.log = jsbLog; + } + else if (console.log.bind) { // use bind to avoid pollute call stacks cc.log = console.log.bind(console); } diff --git a/cocos2d/actions/CCAction.js b/cocos2d/actions/CCAction.js index f7326163b7..1c7b8f9fd7 100644 --- a/cocos2d/actions/CCAction.js +++ b/cocos2d/actions/CCAction.js @@ -28,29 +28,18 @@ * @module cc */ -/** Default Action tag - * @constant - * @type {Number} - * @default - */ -cc.ACTION_TAG_INVALID = -1; - /** * Base class cc.Action for action classes. * @class Action */ cc.Action = cc._Class.extend({ - //***********variables************* - originalTarget:null, - target:null, - tag:cc.ACTION_TAG_INVALID, //**************Public Functions*********** ctor:function () { this.originalTarget = null; this.target = null; - this.tag = cc.ACTION_TAG_INVALID; + this.tag = cc.Action.TAG_INVALID; }, /** @@ -162,11 +151,12 @@ cc.Action = cc._Class.extend({ } }); -cc.action = function () { - return new cc.Action(); -}; - -cc.Action.create = cc.action; +/** Default Action tag + * @constant + * @type {Number} + * @default + */ +cc.Action.TAG_INVALID = -1; /** @@ -364,8 +354,6 @@ cc.speed = function (action, speed) { return new cc.Speed(action, speed); }; -cc.Speed.create = cc.speed; - /* * cc.Follow is a follow action which makes its target follows another node. * @@ -559,5 +547,3 @@ cc.Follow = cc.Action.extend({ cc.follow = function (followedNode, rect) { return new cc.Follow(followedNode, rect); }; - -cc.Follow.create = cc.follow; diff --git a/cocos2d/actions/CCActionCamera.js b/cocos2d/actions/CCActionCamera.js index a346d0733e..ffc3fe5d5a 100644 --- a/cocos2d/actions/CCActionCamera.js +++ b/cocos2d/actions/CCActionCamera.js @@ -275,19 +275,3 @@ cc.OrbitCamera = cc.ActionCamera.extend({ cc.orbitCamera = function (t, radius, deltaRadius, angleZ, deltaAngleZ, angleX, deltaAngleX) { return new cc.OrbitCamera(t, radius, deltaRadius, angleZ, deltaAngleZ, angleX, deltaAngleX); }; - -/** - * Please use cc.orbitCamera instead - * creates a cc.OrbitCamera action with radius, delta-radius, z, deltaZ, x, deltaX - * @param {Number} t time - * @param {Number} radius - * @param {Number} deltaRadius - * @param {Number} angleZ - * @param {Number} deltaAngleZ - * @param {Number} angleX - * @param {Number} deltaAngleX - * @return {OrbitCamera} - * @static - * @deprecated since v3.0 please use cc.orbitCamera() instead. - */ -cc.OrbitCamera.create = cc.orbitCamera; diff --git a/cocos2d/actions/CCActionCatmullRom.js b/cocos2d/actions/CCActionCatmullRom.js index ba1ca274cd..36c7b2b695 100644 --- a/cocos2d/actions/CCActionCatmullRom.js +++ b/cocos2d/actions/CCActionCatmullRom.js @@ -284,8 +284,6 @@ cc.cardinalSplineTo = function (duration, points, tension) { return new cc.CardinalSplineTo(duration, points, tension); }; -cc.CardinalSplineTo.create = cc.cardinalSplineTo; - /* * Cardinal Spline path. http://en.wikipedia.org/wiki/Cubic_Hermite_spline#Cardinal_spline * Relative coordinates. @@ -392,7 +390,6 @@ cc.CardinalSplineBy = cc.CardinalSplineTo.extend({ cc.cardinalSplineBy = function (duration, points, tension) { return new cc.CardinalSplineBy(duration, points, tension); }; -cc.CardinalSplineBy.create = cc.cardinalSplineBy; /* * An action that moves the target with a CatmullRom curve to a destination point.
@@ -446,7 +443,6 @@ cc.CatmullRomTo = cc.CardinalSplineTo.extend({ cc.catmullRomTo = function (dt, points) { return new cc.CatmullRomTo(dt, points); }; -cc.CatmullRomTo.create = cc.catmullRomTo; /* * An action that moves the target with a CatmullRom curve by a certain distance.
@@ -500,4 +496,3 @@ cc.CatmullRomBy = cc.CardinalSplineBy.extend({ cc.catmullRomBy = function (dt, points) { return new cc.CatmullRomBy(dt, points); }; -cc.CatmullRomBy.create = cc.catmullRomBy; diff --git a/cocos2d/actions/CCActionEase.js b/cocos2d/actions/CCActionEase.js index 6857ef5661..0777104624 100644 --- a/cocos2d/actions/CCActionEase.js +++ b/cocos2d/actions/CCActionEase.js @@ -97,8 +97,6 @@ cc.actionEase = function (action) { return new cc.ActionEase(action); }; -cc.ActionEase.create = cc.actionEase; - /** * Base class for Easing actions with rate parameters * @@ -160,8 +158,6 @@ cc.easeRateAction = function (action, rate) { return new cc.EaseRateAction(action, rate); }; -cc.EaseRateAction.create = cc.easeRateAction; - /** * @module cc */ @@ -175,9 +171,6 @@ cc.EaseRateAction.create = cc.easeRateAction; * @deprecated since v3.0 please use action.easing(cc.easeIn(3)); * * @example - * //The old usage - * cc.EaseIn.create(action, 3); - * //The new usage * action.easing(cc.easeIn(3.0)); */ cc.EaseIn = cc.EaseRateAction.extend({ @@ -197,10 +190,6 @@ cc.EaseIn = cc.EaseRateAction.extend({ } }); -cc.EaseIn.create = function (action, rate) { - return new cc.EaseIn(action, rate); -}; - /** * Creates the action easing object with the rate parameter.
* From slow to fast. @@ -233,9 +222,6 @@ cc.easeIn = function (rate) { * @deprecated since v3.0 please use action.easing(cc.easeOut(3)) * * @example - * //The old usage - * cc.EaseOut.create(action, 3); - * //The new usage * action.easing(cc.easeOut(3.0)); */ cc.EaseOut = cc.EaseRateAction.extend({ @@ -254,10 +240,6 @@ cc.EaseOut = cc.EaseRateAction.extend({ } }); -cc.EaseOut.create = function (action, rate) { - return new cc.EaseOut(action, rate); -}; - /** * Creates the action easing object with the rate parameter.
* From fast to slow. @@ -290,9 +272,6 @@ cc.easeOut = function (rate) { * @deprecated since v3.0 please use action.easing(cc.easeInOut(3.0)) * * @example - * //The old usage - * cc.EaseInOut.create(action, 3); - * //The new usage * action.easing(cc.easeInOut(3.0)); */ cc.EaseInOut = cc.EaseRateAction.extend({ @@ -315,10 +294,6 @@ cc.EaseInOut = cc.EaseRateAction.extend({ } }); -cc.EaseInOut.create = function (action, rate) { - return new cc.EaseInOut(action, rate); -}; - /** * Creates the action easing object with the rate parameter.
* Slow to fast then to slow. @@ -356,9 +331,6 @@ cc.easeInOut = function (rate) { * @deprecated since v3.0 please action.easing(cc.easeExponentialIn()) * * @example - * //The old usage - * cc.EaseExponentialIn.create(action); - * //The new usage * action.easing(cc.easeExponentialIn()); */ cc.EaseExponentialIn = cc.ActionEase.extend({ @@ -377,10 +349,6 @@ cc.EaseExponentialIn = cc.ActionEase.extend({ } }); -cc.EaseExponentialIn.create = function (action) { - return new cc.EaseExponentialIn(action); -}; - cc._easeExponentialInObj = { easing: function(dt){ return dt === 0 ? 0 : Math.pow(2, 10 * (dt - 1)); @@ -414,9 +382,6 @@ cc.easeExponentialIn = function(){ * @deprecated since v3.0 please use action.easing(cc.easeExponentialOut()) * * @example - * //The old usage - * cc.EaseExponentialOut.create(action); - * //The new usage * action.easing(cc.easeExponentialOut()); */ cc.EaseExponentialOut = cc.ActionEase.extend({ @@ -435,10 +400,6 @@ cc.EaseExponentialOut = cc.ActionEase.extend({ } }); -cc.EaseExponentialOut.create = function (action) { - return new cc.EaseExponentialOut(action); -}; - cc._easeExponentialOutObj = { easing: function(dt){ return dt === 1 ? 1 : (-(Math.pow(2, -10 * dt)) + 1); @@ -473,9 +434,6 @@ cc.easeExponentialOut = function(){ * @deprecated since v3.0 please use action.easing(cc.easeExponentialInOut) * * @example - * //The old usage - * cc.EaseExponentialInOut.create(action); - * //The new usage * action.easing(cc.easeExponentialInOut()); */ cc.EaseExponentialInOut = cc.ActionEase.extend({ @@ -501,10 +459,6 @@ cc.EaseExponentialInOut = cc.ActionEase.extend({ } }); -cc.EaseExponentialInOut.create = function (action) { - return new cc.EaseExponentialInOut(action); -}; - cc._easeExponentialInOutObj = { easing: function(dt){ if( dt !== 1 && dt !== 0) { @@ -545,9 +499,6 @@ cc.easeExponentialInOut = function(){ * @deprecated since v3.0 please use action.easing(cc.easeSineIn()) * * @example - * //The old usage - * cc.EaseSineIn.create(action); - * //The new usage * action.easing(cc.easeSineIn()); */ cc.EaseSineIn = cc.ActionEase.extend({ @@ -567,10 +518,6 @@ cc.EaseSineIn = cc.ActionEase.extend({ } }); -cc.EaseSineIn.create = function (action) { - return new cc.EaseSineIn(action); -}; - cc._easeSineInObj = { easing: function(dt){ return (dt===0 || dt===1) ? dt : -1 * Math.cos(dt * Math.PI / 2) + 1; @@ -603,9 +550,6 @@ cc.easeSineIn = function(){ * @deprecated since v3.0 please use action.easing(cc.easeSineOut()) * * @example - * //The old usage - * cc.EaseSineOut.create(action); - * //The new usage * action.easing(cc.easeSineOut()); */ cc.EaseSineOut = cc.ActionEase.extend({ @@ -625,10 +569,6 @@ cc.EaseSineOut = cc.ActionEase.extend({ } }); -cc.EaseSineOut.create = function (action) { - return new cc.EaseSineOut(action); -}; - cc._easeSineOutObj = { easing: function(dt){ return (dt===0 || dt===1) ? dt : Math.sin(dt * Math.PI / 2); @@ -662,9 +602,6 @@ cc.easeSineOut = function(){ * @deprecated since v3.0 please use action.easing(cc.easeSineInOut()) * * @example - * //The old usage - * cc.EaseSineInOut.create(action); - * //The new usage * action.easing(cc.easeSineInOut()); */ cc.EaseSineInOut = cc.ActionEase.extend({ @@ -684,10 +621,6 @@ cc.EaseSineInOut = cc.ActionEase.extend({ } }); -cc.EaseSineInOut.create = function (action) { - return new cc.EaseSineInOut(action); -}; - cc._easeSineInOutObj = { easing: function(dt){ return (dt === 0 || dt === 1) ? dt : -0.5 * (Math.cos(Math.PI * dt) - 1); @@ -767,10 +700,6 @@ cc.EaseElastic = cc.ActionEase.extend({ } }); -cc.EaseElastic.create = function (action, period) { - return new cc.EaseElastic(action, period); -}; - /** * @module cc */ @@ -786,9 +715,6 @@ cc.EaseElastic.create = function (action, period) { * @deprecated since v3.0 please use action.easing(cc.easeElasticIn()) * * @example - * //The old usage - * cc.EaseElasticIn.create(action, period); - * //The new usage * action.easing(cc.easeElasticIn(period)); */ cc.EaseElasticIn = cc.EaseElastic.extend({ @@ -815,10 +741,6 @@ cc.EaseElasticIn = cc.EaseElastic.extend({ } }); -cc.EaseElasticIn.create = function (action, period) { - return new cc.EaseElasticIn(action, period); -}; - //default ease elastic in object (period = 0.3) cc._easeElasticInObj = { easing:function(dt){ @@ -872,9 +794,6 @@ cc.easeElasticIn = function (period) { * @deprecated since v3.0
Please use action.easing(cc.easeElasticOut(period)) * * @example - * //The old usage - * cc.EaseElasticOut.create(action, period); - * //The new usage * action.easing(cc.easeElasticOut(period)); */ cc.EaseElasticOut = cc.EaseElastic.extend({ @@ -901,10 +820,6 @@ cc.EaseElasticOut = cc.EaseElastic.extend({ } }); -cc.EaseElasticOut.create = function (action, period) { - return new cc.EaseElasticOut(action, period); -}; - //default ease elastic out object (period = 0.3) cc._easeElasticOutObj = { easing: function (dt) { @@ -951,9 +866,6 @@ cc.easeElasticOut = function (period) { * @deprecated since v3.0 please use action.easing(cc.easeElasticInOut()) * * @example - * //The old usage - * cc.EaseElasticInOut.create(action, period); - * //The new usage * action.easing(cc.easeElasticInOut(period)); */ cc.EaseElasticInOut = cc.EaseElastic.extend({ @@ -988,10 +900,6 @@ cc.EaseElasticInOut = cc.EaseElastic.extend({ } }); -cc.EaseElasticInOut.create = function (action, period) { - return new cc.EaseElasticInOut(action, period); -}; - /** * Creates the action easing object with the period in radians (default is 0.3).
* Reference easeInOutElastic:
@@ -1068,10 +976,6 @@ cc.EaseBounce = cc.ActionEase.extend({ } }); -cc.EaseBounce.create = function (action) { - return new cc.EaseBounce(action); -}; - /** * @module cc */ @@ -1086,9 +990,6 @@ cc.EaseBounce.create = function (action) { * @deprecated since v3.0 please use action.easing(cc.easeBounceIn()) * * @example - * //The old usage - * cc.EaseBounceIn.create(action); - * //The new usage * action.easing(cc.easeBounceIn()); */ cc.EaseBounceIn = cc.EaseBounce.extend({ @@ -1108,10 +1009,6 @@ cc.EaseBounceIn = cc.EaseBounce.extend({ } }); -cc.EaseBounceIn.create = function (action) { - return new cc.EaseBounceIn(action); -}; - cc._bounceTime = function (time1) { if (time1 < 1 / 2.75) { return 7.5625 * time1 * time1; @@ -1159,9 +1056,6 @@ cc.easeBounceIn = function(){ * @deprecated since v3.0 please use action.easing(cc.easeBounceOut()) * * @example - * //The old usage - * cc.EaseBounceOut.create(action); - * //The new usage * action.easing(cc.easeBounceOut()); */ cc.EaseBounceOut = cc.EaseBounce.extend({ @@ -1181,10 +1075,6 @@ cc.EaseBounceOut = cc.EaseBounce.extend({ } }); -cc.EaseBounceOut.create = function (action) { - return new cc.EaseBounceOut(action); -}; - cc._easeBounceOutObj = { easing: function(dt){ return cc._bounceTime(dt); @@ -1217,9 +1107,6 @@ cc.easeBounceOut = function(){ * @deprecated since v3.0
Please use acton.easing(cc.easeBounceInOut()) * * @example - * //The old usage - * cc.EaseBounceInOut.create(action); - * //The new usage * action.easing(cc.easeBounceInOut()); */ cc.EaseBounceInOut = cc.EaseBounce.extend({ @@ -1245,10 +1132,6 @@ cc.EaseBounceInOut = cc.EaseBounce.extend({ } }); -cc.EaseBounceInOut.create = function (action) { - return new cc.EaseBounceInOut(action); -}; - cc._easeBounceInOutObj = { easing: function (time1) { var newT; @@ -1288,9 +1171,6 @@ cc.easeBounceInOut = function(){ * @deprecated since v3.0 please use action.easing(cc.easeBackIn()) * * @example - * //The old usage - * cc.EaseBackIn.create(action); - * //The new usage * action.easing(cc.easeBackIn()); */ cc.EaseBackIn = cc.ActionEase.extend({ @@ -1311,10 +1191,6 @@ cc.EaseBackIn = cc.ActionEase.extend({ } }); -cc.EaseBackIn.create = function (action) { - return new cc.EaseBackIn(action); -}; - cc._easeBackInObj = { easing: function (time1) { var overshoot = 1.70158; @@ -1348,9 +1224,6 @@ cc.easeBackIn = function(){ * @deprecated since v3.0 please use action.easing(cc.easeBackOut()); * * @example - * //The old usage - * cc.EaseBackOut.create(action); - * //The new usage * action.easing(cc.easeBackOut()); */ cc.EaseBackOut = cc.ActionEase.extend({ @@ -1371,10 +1244,6 @@ cc.EaseBackOut = cc.ActionEase.extend({ } }); -cc.EaseBackOut.create = function (action) { - return new cc.EaseBackOut(action); -}; - cc._easeBackOutObj = { easing: function (time1) { var overshoot = 1.70158; @@ -1409,9 +1278,6 @@ cc.easeBackOut = function(){ * @deprecated since v3.0
Please use action.easing(cc.easeBackInOut()) * * @example - * //The old usage - * cc.EaseBackInOut.create(action); - * //The new usage * action.easing(cc.easeBackInOut()); */ cc.EaseBackInOut = cc.ActionEase.extend({ @@ -1437,10 +1303,6 @@ cc.EaseBackInOut = cc.ActionEase.extend({ } }); -cc.EaseBackInOut.create = function (action) { - return new cc.EaseBackInOut(action); -}; - cc._easeBackInOutObj = { easing: function (time1) { var overshoot = 1.70158 * 1.525; @@ -1481,10 +1343,6 @@ cc.easeBackInOut = function(){ * @deprecated since v3.0
Please use action.easing(cc.easeBezierAction()) * * @example - * //The old usage - * var action = cc.EaseBezierAction.create(action); - * action.setBezierParamer(0.5, 0.5, 1.0, 1.0); - * //The new usage * action.easing(cc.easeBezierAction(0.5, 0.5, 1.0, 1.0)); */ cc.EaseBezierAction = cc.ActionEase.extend({ @@ -1540,10 +1398,6 @@ cc.EaseBezierAction = cc.ActionEase.extend({ } }); -cc.EaseBezierAction.create = function(action){ - return new cc.EaseBezierAction(action); -}; - /** * Creates the action easing object.
* Into the 4 reference point.
@@ -1579,9 +1433,6 @@ cc.easeBezierAction = function(p0, p1, p2, p3){ * @deprecated since v3.0
Please use action.easing(cc.easeQuadraticAction()) * * @example - * //The old usage - * cc.EaseQuadraticActionIn.create(action); - * //The new usage * action.easing(cc.easeQuadraticActionIn()); */ cc.EaseQuadraticActionIn = cc.ActionEase.extend({ @@ -1606,10 +1457,6 @@ cc.EaseQuadraticActionIn = cc.ActionEase.extend({ }); -cc.EaseQuadraticActionIn.create = function(action){ - return new cc.EaseQuadraticActionIn(action); -}; - cc._easeQuadraticActionIn = { easing: cc.EaseQuadraticActionIn.prototype._updateTime, reverse: function(){ @@ -1641,9 +1488,6 @@ cc.easeQuadraticActionIn = function(){ * @deprecated since v3.0
Please use action.easing(cc.easeQuadraticActionOut()) * * @example - * //The old usage - * cc.EaseQuadraticActionOut.create(action); - * //The new usage * action.easing(cc.easeQuadraticActionOut()); */ cc.EaseQuadraticActionOut = cc.ActionEase.extend({ @@ -1667,10 +1511,6 @@ cc.EaseQuadraticActionOut = cc.ActionEase.extend({ } }); -cc.EaseQuadraticActionOut.create = function(action){ - return new cc.EaseQuadraticActionOut(action); -}; - cc._easeQuadraticActionOut = { easing: cc.EaseQuadraticActionOut.prototype._updateTime, reverse: function(){ @@ -1701,9 +1541,6 @@ cc.easeQuadraticActionOut = function(){ * @deprecated since v3.0
Please use action.easing(cc.easeQuadraticActionInOut()) * * @example - * //The old usage - * cc.EaseQuadraticActionInOut.create(action); - * //The new usage * action.easing(cc.easeQuadraticActionInOut()); */ cc.EaseQuadraticActionInOut = cc.ActionEase.extend({ @@ -1734,10 +1571,6 @@ cc.EaseQuadraticActionInOut = cc.ActionEase.extend({ } }); -cc.EaseQuadraticActionInOut.create = function(action){ - return new cc.EaseQuadraticActionInOut(action); -}; - cc._easeQuadraticActionInOut = { easing: cc.EaseQuadraticActionInOut.prototype._updateTime, reverse: function(){ @@ -1769,9 +1602,6 @@ cc.easeQuadraticActionInOut = function(){ * @deprecated since v3.0
Please use action.easing(cc.easeQuarticActionIn()); * * @example - * //The old usage - * cc.EaseQuarticActionIn.create(action); - * //The new usage * action.easing(cc.easeQuarticActionIn()); */ cc.EaseQuarticActionIn = cc.ActionEase.extend({ @@ -1794,10 +1624,6 @@ cc.EaseQuarticActionIn = cc.ActionEase.extend({ } }); -cc.EaseQuarticActionIn.create = function(action){ - return new cc.EaseQuarticActionIn(action); -}; - cc._easeQuarticActionIn = { easing: cc.EaseQuarticActionIn.prototype._updateTime, reverse: function(){ @@ -1828,9 +1654,6 @@ cc.easeQuarticActionIn = function(){ * @deprecated since v3.0
Please use action.easing(cc.QuarticActionOut()); * * @example - * //The old usage - * cc.EaseQuarticActionOut.create(action); - * //The new usage * action.easing(cc.EaseQuarticActionOut()); */ cc.EaseQuarticActionOut = cc.ActionEase.extend({ @@ -1854,10 +1677,6 @@ cc.EaseQuarticActionOut = cc.ActionEase.extend({ } }); -cc.EaseQuarticActionOut.create = function(action){ - return new cc.EaseQuarticActionOut(action); -}; - cc._easeQuarticActionOut = { easing: cc.EaseQuarticActionOut.prototype._updateTime, reverse: function(){ @@ -1889,9 +1708,6 @@ cc.easeQuarticActionOut = function(){ * @deprecated since v3.0
Please use action.easing(cc.easeQuarticActionInOut()); * * @example - * //The old usage - * cc.EaseQuarticActionInOut.create(action); - * //The new usage * action.easing(cc.easeQuarticActionInOut()); */ cc.EaseQuarticActionInOut = cc.ActionEase.extend({ @@ -1918,10 +1734,6 @@ cc.EaseQuarticActionInOut = cc.ActionEase.extend({ } }); -cc.EaseQuarticActionInOut.create = function(action){ - return new cc.EaseQuarticActionInOut(action); -}; - cc._easeQuarticActionInOut = { easing: cc.EaseQuarticActionInOut.prototype._updateTime, reverse: function(){ @@ -1949,9 +1761,6 @@ cc.easeQuarticActionInOut = function(){ * @deprecated since v3.0
Please use action.easing(cc.easeQuinticActionIn()); * * @example - * //The old usage - * cc.EaseQuinticActionIn.create(action); - * //The new usage * action.easing(cc.easeQuinticActionIn()); */ cc.EaseQuinticActionIn = cc.ActionEase.extend({ @@ -1974,10 +1783,6 @@ cc.EaseQuinticActionIn = cc.ActionEase.extend({ } }); -cc.EaseQuinticActionIn.create = function(action){ - return new cc.EaseQuinticActionIn(action); -}; - cc._easeQuinticActionIn = { easing: cc.EaseQuinticActionIn.prototype._updateTime, reverse: function(){ @@ -2009,9 +1814,6 @@ cc.easeQuinticActionIn = function(){ * @deprecated since v3.0
Please use action.easing(cc.easeQuadraticActionOut()); * * @example - * //The old usage - * cc.EaseQuinticActionOut.create(action); - * //The new usage * action.easing(cc.easeQuadraticActionOut()); */ cc.EaseQuinticActionOut = cc.ActionEase.extend({ @@ -2035,10 +1837,6 @@ cc.EaseQuinticActionOut = cc.ActionEase.extend({ } }); -cc.EaseQuinticActionOut.create = function(action){ - return new cc.EaseQuinticActionOut(action); -}; - cc._easeQuinticActionOut = { easing: cc.EaseQuinticActionOut.prototype._updateTime, reverse: function(){ @@ -2070,9 +1868,6 @@ cc.easeQuinticActionOut = function(){ * @deprecated since v3.0
Please use action.easing(cc.easeQuinticActionInOut()); * * @example - * //The old usage - * cc.EaseQuinticActionInOut.create(action); - * //The new usage * action.easing(cc.easeQuinticActionInOut()); */ cc.EaseQuinticActionInOut = cc.ActionEase.extend({ @@ -2099,10 +1894,6 @@ cc.EaseQuinticActionInOut = cc.ActionEase.extend({ } }); -cc.EaseQuinticActionInOut.create = function(action){ - return new cc.EaseQuinticActionInOut(action); -}; - cc._easeQuinticActionInOut = { easing: cc.EaseQuinticActionInOut.prototype._updateTime, reverse: function(){ @@ -2134,9 +1925,6 @@ cc.easeQuinticActionInOut = function(){ * @deprecated since v3.0
Please use action.easing(cc.easeCircleActionIn()); * * @example - * //The old usage - * cc.EaseCircleActionIn.create(action); - * //The new usage * action.easing(cc.easeCircleActionIn()); */ cc.EaseCircleActionIn = cc.ActionEase.extend({ @@ -2159,10 +1947,6 @@ cc.EaseCircleActionIn = cc.ActionEase.extend({ } }); -cc.EaseCircleActionIn.create = function(action){ - return new cc.EaseCircleActionIn(action); -}; - cc._easeCircleActionIn = { easing: cc.EaseCircleActionIn.prototype._updateTime, reverse: function(){ @@ -2194,9 +1978,6 @@ cc.easeCircleActionIn = function(){ * @deprecated since v3.0
Please use action.easing(cc.easeCircleActionOut()); * * @example - * //The old usage - * cc.EaseCircleActionOut.create(action); - * //The new usage * action.easing(cc.easeCircleActionOut()); */ cc.EaseCircleActionOut = cc.ActionEase.extend({ @@ -2220,10 +2001,6 @@ cc.EaseCircleActionOut = cc.ActionEase.extend({ } }); -cc.EaseCircleActionOut.create = function(action){ - return new cc.EaseCircleActionOut(action); -}; - cc._easeCircleActionOut = { easing: cc.EaseCircleActionOut.prototype._updateTime, reverse: function(){ @@ -2255,9 +2032,6 @@ cc.easeCircleActionOut = function(){ * @deprecated since v3.0
Please use action.easing(cc.easeCircleActionInOut()); * * @example - * //The old usage - * cc.EaseCircleActionInOut.create(action); - * //The new usage * action.easing(cc.easeCircleActionInOut()); */ cc.EaseCircleActionInOut = cc.ActionEase.extend({ @@ -2284,10 +2058,6 @@ cc.EaseCircleActionInOut = cc.ActionEase.extend({ } }); -cc.EaseCircleActionInOut.create = function(action){ - return new cc.EaseCircleActionInOut(action); -}; - cc._easeCircleActionInOut = { easing: cc.EaseCircleActionInOut.prototype._updateTime, reverse: function(){ @@ -2319,9 +2089,6 @@ cc.easeCircleActionInOut = function(){ * @deprecated since v3.0
action.easing(cc.easeCubicActionIn()); * * @example - * //The old usage - * cc.EaseCubicActionIn.create(action); - * //The new usage * action.easing(cc.easeCubicActionIn()); */ cc.EaseCubicActionIn = cc.ActionEase.extend({ @@ -2344,10 +2111,6 @@ cc.EaseCubicActionIn = cc.ActionEase.extend({ } }); -cc.EaseCubicActionIn.create = function(action){ - return new cc.EaseCubicActionIn(action); -}; - cc._easeCubicActionIn = { easing: cc.EaseCubicActionIn.prototype._updateTime, reverse: function(){ @@ -2379,9 +2142,6 @@ cc.easeCubicActionIn = function(){ * @deprecated since v3.0
Please use action.easing(cc.easeCubicActionOut()); * * @example - * //The old usage - * cc.EaseCubicActionOut.create(action); - * //The new usage * action.easing(cc.easeCubicActionOut()); */ cc.EaseCubicActionOut = cc.ActionEase.extend({ @@ -2405,10 +2165,6 @@ cc.EaseCubicActionOut = cc.ActionEase.extend({ } }); -cc.EaseCubicActionOut.create = function(action){ - return new cc.EaseCubicActionOut(action); -}; - cc._easeCubicActionOut = { easing: cc.EaseCubicActionOut.prototype._updateTime, reverse: function(){ @@ -2440,9 +2196,6 @@ cc.easeCubicActionOut = function(){ * @deprecated since v3.0
Please use action.easing(cc.easeCubicActionInOut()); * * @example - * //The old usage - * cc.EaseCubicActionInOut.create(action); - * //The new usage * action.easing(cc.easeCubicActionInOut()); */ cc.EaseCubicActionInOut = cc.ActionEase.extend({ @@ -2469,10 +2222,6 @@ cc.EaseCubicActionInOut = cc.ActionEase.extend({ } }); -cc.EaseCubicActionInOut.create = function(action){ - return new cc.EaseCubicActionInOut(action); -}; - cc._easeCubicActionInOut = { easing: cc.EaseCubicActionInOut.prototype._updateTime, reverse: function(){ diff --git a/cocos2d/actions/CCActionInstant.js b/cocos2d/actions/CCActionInstant.js index d083417421..b5679ec581 100644 --- a/cocos2d/actions/CCActionInstant.js +++ b/cocos2d/actions/CCActionInstant.js @@ -98,8 +98,6 @@ cc.show = function () { return new cc.Show(); }; -cc.Show.create = cc.show; - /* * Hide the node. * @class Hide @@ -132,8 +130,6 @@ cc.hide = function () { return new cc.Hide(); }; -cc.Hide.create = cc.hide; - /* * Toggles the visibility of a node. * @class ToggleVisibility @@ -166,8 +162,6 @@ cc.toggleVisibility = function () { return new cc.ToggleVisibility(); }; -cc.ToggleVisibility.create = cc.toggleVisibility; - /* * Delete self in the next frame. * @class RemoveSelf @@ -220,8 +214,6 @@ cc.removeSelf = function(isNeedCleanUp){ return new cc.RemoveSelf(isNeedCleanUp); }; -cc.RemoveSelf.create = cc.removeSelf; - /* * Flips the sprite horizontally. * @class FlipX @@ -278,8 +270,6 @@ cc.flipX = function (flip) { return new cc.FlipX(flip); }; -cc.FlipX.create = cc.flipX; - /* * Flips the sprite vertically * @class FlipY @@ -336,8 +326,6 @@ cc.flipY = function (flip) { return new cc.FlipY(flip); }; -cc.FlipY.create = cc.flipY; - /* * Places the node in a certain position * @class Place @@ -404,8 +392,6 @@ cc.place = function (pos, y) { return new cc.Place(pos, y); }; -cc.Place.create = cc.place; - /* * Calls a 'callback'. @@ -518,5 +504,3 @@ cc.CallFunc = cc.ActionInstant.extend({ cc.callFunc = function (selector, selectorTarget, data) { return new cc.CallFunc(selector, selectorTarget, data); }; - -cc.CallFunc.create = cc.callFunc; diff --git a/cocos2d/actions/CCActionInterval.js b/cocos2d/actions/CCActionInterval.js index 6d47721ef6..00d3553358 100644 --- a/cocos2d/actions/CCActionInterval.js +++ b/cocos2d/actions/CCActionInterval.js @@ -278,8 +278,6 @@ cc.actionInterval = function (d) { return new cc.ActionInterval(d); }; -cc.ActionInterval.create = cc.actionInterval; - /** * @module cc */ @@ -458,8 +456,6 @@ cc.sequence = function (/*Multiple Arguments*/tempArray) { return result; }; -cc.Sequence.create = cc.sequence; - cc.Sequence._actionOneTwo = function (actionOne, actionTwo) { var sequence = new cc.Sequence(); sequence.initWithTwoActions(actionOne, actionTwo); @@ -609,8 +605,6 @@ cc.repeat = function (action, times) { return new cc.Repeat(action, times); }; -cc.Repeat.create = cc.repeat; - /* * Repeats an action for ever.
@@ -712,8 +706,6 @@ cc.repeatForever = function (action) { return new cc.RepeatForever(action); }; -cc.RepeatForever.create = cc.repeatForever; - /* * Spawn a new action immediately @@ -833,8 +825,6 @@ cc.spawn = function (/*Multiple Arguments*/tempArray) { return prev; }; -cc.Spawn.create = cc.spawn; - cc.Spawn._actionOneTwo = function (action1, action2) { var pSpawn = new cc.Spawn(); pSpawn.initWithTwoActions(action1, action2); @@ -943,8 +933,6 @@ cc.rotateTo = function (duration, deltaAngleX, deltaAngleY) { return new cc.RotateTo(duration, deltaAngleX, deltaAngleY); }; -cc.RotateTo.create = cc.rotateTo; - /* * Rotates a Node object clockwise a number of degrees by modifying its rotation property. @@ -1030,8 +1018,6 @@ cc.rotateBy = function (duration, deltaAngleX, deltaAngleY) { return new cc.RotateBy(duration, deltaAngleX, deltaAngleY); }; -cc.RotateBy.create = cc.rotateBy; - /* *

@@ -1151,8 +1137,6 @@ cc.moveBy = function (duration, deltaPos, deltaY) { return new cc.MoveBy(duration, deltaPos, deltaY); }; -cc.MoveBy.create = cc.moveBy; - /* * Moves a Node object to the position x,y. x and y are absolute coordinates by modifying its position property.
@@ -1228,8 +1212,6 @@ cc.moveTo = function (duration, position, y) { return new cc.MoveTo(duration, position, y); }; -cc.MoveTo.create = cc.moveTo; - /* * Skews a Node object to given angles by modifying its skewX and skewY properties * @class SkewTo @@ -1321,8 +1303,6 @@ cc.skewTo = function (t, sx, sy) { return new cc.SkewTo(t, sx, sy); }; -cc.SkewTo.create = cc.skewTo; - /* * Skews a Node object by skewX and skewY degrees. * Relative to its property modification. @@ -1394,7 +1374,6 @@ cc.SkewBy = cc.SkewTo.extend({ cc.skewBy = function (t, sx, sy) { return new cc.SkewBy(t, sx, sy); }; -cc.SkewBy.create = cc.skewBy; /* @@ -1525,7 +1504,6 @@ cc.JumpBy = cc.ActionInterval.extend({ cc.jumpBy = function (duration, position, y, height, jumps) { return new cc.JumpBy(duration, position, y, height, jumps); }; -cc.JumpBy.create = cc.jumpBy; /* * Moves a Node object to a parabolic position simulating a jump movement by modifying it's position property.
@@ -1608,8 +1586,6 @@ cc.jumpTo = function (duration, position, y, height, jumps) { return new cc.JumpTo(duration, position, y, height, jumps); }; -cc.JumpTo.create = cc.jumpTo; - /* * @method bezierAt * @param {Number} a @@ -1750,7 +1726,6 @@ cc.BezierBy = cc.ActionInterval.extend({ cc.bezierBy = function (t, c) { return new cc.BezierBy(t, c); }; -cc.BezierBy.create = cc.bezierBy; /* An action that moves the target with a cubic Bezier curve to a destination point. @@ -1817,7 +1792,6 @@ cc.BezierTo = cc.BezierBy.extend({ cc.bezierTo = function (t, c) { return new cc.BezierTo(t, c); }; -cc.BezierTo.create = cc.bezierTo; /* Scales a Node object to a zoom factor by modifying it's scale property. @@ -1906,7 +1880,6 @@ cc.ScaleTo = cc.ActionInterval.extend({ cc.scaleTo = function (duration, sx, sy) { //function overload return new cc.ScaleTo(duration, sx, sy); }; -cc.ScaleTo.create = cc.scaleTo; /* Scales a Node object a zoom factor by modifying it's scale property. @@ -1953,7 +1926,6 @@ cc.ScaleBy = cc.ScaleTo.extend({ cc.scaleBy = function (duration, sx, sy) { return new cc.ScaleBy(duration, sx, sy); }; -cc.ScaleBy.create = cc.scaleBy; /* Blinks a Node object by modifying it's visible property * @class Blink @@ -2032,7 +2004,6 @@ cc.Blink = cc.ActionInterval.extend({ cc.blink = function (duration, blinks) { return new cc.Blink(duration, blinks); }; -cc.Blink.create = cc.blink; /* Fades an object that implements the cc.RGBAProtocol protocol. It modifies the opacity from the current value to a custom one. * @warning This action doesn't support "reverse" @@ -2098,7 +2069,6 @@ cc.FadeTo = cc.ActionInterval.extend({ cc.fadeTo = function (duration, opacity) { return new cc.FadeTo(duration, opacity); }; -cc.FadeTo.create = cc.fadeTo; /* Fades In an object that implements the cc.RGBAProtocol protocol. It modifies the opacity from 0 to 255.
* The "reverse" of this action is FadeOut @@ -2150,7 +2120,6 @@ cc.FadeIn = cc.FadeTo.extend({ cc.fadeIn = function (duration) { return new cc.FadeIn(duration); }; -cc.FadeIn.create = cc.fadeIn; /* Fades Out an object that implements the cc.RGBAProtocol protocol. It modifies the opacity from 255 to 0. @@ -2197,7 +2166,6 @@ cc.FadeOut = cc.FadeTo.extend({ cc.fadeOut = function (d) { return new cc.FadeOut(d); }; -cc.FadeOut.create = cc.fadeOut; /* Tints a Node that implements the cc.NodeRGB protocol from current tint to a custom one. * @warning This action doesn't support "reverse" @@ -2281,7 +2249,6 @@ cc.TintTo = cc.ActionInterval.extend({ cc.tintTo = function (duration, red, green, blue) { return new cc.TintTo(duration, red, green, blue); }; -cc.TintTo.create = cc.tintTo; /* Tints a Node that implements the cc.NodeRGB protocol from current tint to a custom one. @@ -2375,7 +2342,6 @@ cc.TintBy = cc.ActionInterval.extend({ cc.tintBy = function (duration, deltaRed, deltaGreen, deltaBlue) { return new cc.TintBy(duration, deltaRed, deltaGreen, deltaBlue); }; -cc.TintBy.create = cc.tintBy; /* Delays the action a certain amount of seconds * @class DelayTime @@ -2411,7 +2377,6 @@ cc.DelayTime = cc.ActionInterval.extend({ cc.delayTime = function (d) { return new cc.DelayTime(d); }; -cc.DelayTime.create = cc.delayTime; /* *

@@ -2494,7 +2459,6 @@ cc.ReverseTime = cc.ActionInterval.extend({ cc.reverseTime = function (action) { return new cc.ReverseTime(action); }; -cc.ReverseTime.create = cc.reverseTime; /** * This API is deprecated, will be replaced by new API from {{#crossLink "Animation"}}cc.Animation{{/crossLink}} @@ -2665,7 +2629,6 @@ cc.Animate = cc.ActionInterval.extend({ cc.animate = function (animation) { return new cc.Animate(animation); }; -cc.Animate.create = cc.animate; /* *

@@ -2750,4 +2713,3 @@ cc.TargetedAction = cc.ActionInterval.extend({ cc.targetedAction = function (target, action) { return new cc.TargetedAction(target, action); }; -cc.TargetedAction.create = cc.targetedAction; diff --git a/cocos2d/actions/index.js b/cocos2d/actions/index.js new file mode 100644 index 0000000000..beed958d32 --- /dev/null +++ b/cocos2d/actions/index.js @@ -0,0 +1,4 @@ +require('./CCAction.js'); +require('./CCActionInterval.js'); +require('./CCActionInstant.js'); +require('./CCActionEase.js'); \ No newline at end of file diff --git a/cocos2d/core/CCActionManager.js b/cocos2d/core/CCActionManager.js index 8a456d84a0..9ad5d8d58b 100644 --- a/cocos2d/core/CCActionManager.js +++ b/cocos2d/core/CCActionManager.js @@ -183,7 +183,7 @@ cc.ActionManager = cc._Class.extend(/** @lends cc.ActionManager# */{ * @param {object} target */ removeActionByTag:function (tag, target) { - if(tag === cc.ACTION_TAG_INVALID) + if(tag === cc.Action.TAG_INVALID) cc.log(cc._LogInfos.ActionManager.addAction); cc.assert(target, cc._LogInfos.ActionManager.addAction); @@ -209,7 +209,7 @@ cc.ActionManager = cc._Class.extend(/** @lends cc.ActionManager# */{ * @return {Action|Null} return the Action with the given tag on success */ getActionByTag:function (tag, target) { - if(tag === cc.ACTION_TAG_INVALID) + if(tag === cc.Action.TAG_INVALID) cc.log(cc._LogInfos.ActionManager.getActionByTag); var element = this._hashTargets[target.__instanceId]; diff --git a/cocos2d/core/CCDrawingPrimitivesCanvas.js b/cocos2d/core/CCDrawingPrimitivesCanvas.js index 0435ea71c0..7ac37e5770 100644 --- a/cocos2d/core/CCDrawingPrimitivesCanvas.js +++ b/cocos2d/core/CCDrawingPrimitivesCanvas.js @@ -288,7 +288,7 @@ cc.DrawingPrimitiveCanvas = cc._Class.extend(/** @lends cc.DrawingPrimitiveCanva } // Interpolate - var newPos = cc.CardinalSplineAt( + var newPos = cc.cardinalSplineAt( cc.getControlPointAt(config, p - 1), cc.getControlPointAt(config, p - 0), cc.getControlPointAt(config, p + 1), diff --git a/cocos2d/core/CCNode.js b/cocos2d/core/CCNode.js index 95f9ee15d5..c1103eed96 100644 --- a/cocos2d/core/CCNode.js +++ b/cocos2d/core/CCNode.js @@ -1162,7 +1162,7 @@ var Node = cc.Class({ * @param {Number} tag A tag that indicates the action to be removed. */ stopActionByTag: function (tag) { - if (tag === cc.ACTION_TAG_INVALID) { + if (tag === cc.Action.TAG_INVALID) { cc.log(cc._LogInfos.Node.stopActionByTag); return; } @@ -1177,7 +1177,7 @@ var Node = cc.Class({ * @return {Action} The action object with the given tag. */ getActionByTag: function (tag) { - if (tag === cc.ACTION_TAG_INVALID) { + if (tag === cc.Action.TAG_INVALID) { cc.log(cc._LogInfos.Node.getActionByTag); return null; } diff --git a/cocos2d/core/base-nodes/CCSGNode.js b/cocos2d/core/base-nodes/CCSGNode.js index 5e8591c386..0fc621b6cd 100644 --- a/cocos2d/core/base-nodes/CCSGNode.js +++ b/cocos2d/core/base-nodes/CCSGNode.js @@ -1478,7 +1478,7 @@ _ccsg.Node = cc.Class({ * @param {Number} tag A tag that indicates the action to be removed. */ stopActionByTag: function (tag) { - if (tag === cc.ACTION_TAG_INVALID) { + if (tag === cc.Action.TAG_INVALID) { cc.log(cc._LogInfos.Node.stopActionByTag); return; } @@ -1493,7 +1493,7 @@ _ccsg.Node = cc.Class({ * @return {cc.Action} The action object with the given tag. */ getActionByTag: function (tag) { - if (tag === cc.ACTION_TAG_INVALID) { + if (tag === cc.Action.TAG_INVALID) { cc.log(cc._LogInfos.Node.getActionByTag); return null; } diff --git a/cocos2d/core/load-pipeline/downloader.js b/cocos2d/core/load-pipeline/downloader.js index 073326c412..82266c8395 100644 --- a/cocos2d/core/load-pipeline/downloader.js +++ b/cocos2d/core/load-pipeline/downloader.js @@ -135,7 +135,7 @@ function downloadImage (item, callback, isCrossOrigin) { var url = urlAppendTimestamp(item.url); var img = new Image(); if (isCrossOrigin && window.location.origin !== 'file://') { - img.crossOrigin = 'Anonymous'; + img.crossOrigin = 'anonymous'; } if (img.complete && img.naturalWidth > 0) { diff --git a/gulp/tasks/build-cocos2d.js b/gulp/tasks/build-cocos2d.js index f7aad649e8..eb14e7b6e1 100644 --- a/gulp/tasks/build-cocos2d.js +++ b/gulp/tasks/build-cocos2d.js @@ -127,11 +127,6 @@ var srcs = [ './cocos2d/clipping-nodes/CCClippingNodeWebGLRenderCmd.js', './cocos2d/core/CCActionManager.js', - './cocos2d/actions/CCAction.js', - './cocos2d/actions/CCActionInterval.js', - './cocos2d/actions/CCActionInstant.js', - './cocos2d/actions/CCActionEase.js', - './cocos2d/actions/CCActionCatmullRom.js', './cocos2d/progress-timer/CCProgressTimer.js', './cocos2d/progress-timer/CCProgressTimerCanvasRenderCmd.js', diff --git a/jsb/index.js b/jsb/index.js index 2109e82f53..c514fe4d40 100644 --- a/jsb/index.js +++ b/jsb/index.js @@ -35,6 +35,16 @@ cc.initEngine = function (config, cb) { if (cb) cb(); }; +// overwrite original console.log +try { + var originLog = console.log; + console.log = function () { + originLog.call(console, cc.formatStr.apply(null, arguments)); + }; +} +catch (e) { +} + require('./jsb-predefine'); require('./jsb-loader'); require('./jsb-game'); @@ -78,13 +88,3 @@ if (_engineNumberVersion) { } } } - -// var originLog = console.log; -var log = function () { - console.log.call(console, cc.formatStr.apply(null, arguments)); -}; - -cc.log = log; -cc.error = log; -cc.warn = log; -cc.info = log; diff --git a/predefine.js b/predefine.js index bef17c7840..56ba694d85 100644 --- a/predefine.js +++ b/predefine.js @@ -63,6 +63,10 @@ require('./cocos2d/core/CCDirectorWebGL'); require('./cocos2d/core/CCDirectorCanvas'); require('./cocos2d/core/textures'); +if (!CC_JSB) { + require('./cocos2d/actions'); +} + ccui = {}; ccs = {}; cp = {};