Skip to content

Commit b7d8abd

Browse files
committed
Merge pull request #1143 from dingpinglv/Iss2803_V2.1.6Release
Issue #2803: cc.Sprite's setFlipX, setFlipY have renamed to setFlippedX, setFlippedY
2 parents d8f0fbd + e5114d9 commit b7d8abd

File tree

10 files changed

+67
-73
lines changed

10 files changed

+67
-73
lines changed

cocos2d/actions/CCActionInstant.js

+12-12
Original file line numberDiff line numberDiff line change
@@ -203,37 +203,37 @@ cc.RemoveSelf.create = function(isNeedCleanUp){
203203
* @extends cc.ActionInstant
204204
*/
205205
cc.FlipX = cc.ActionInstant.extend(/** @lends cc.FlipX# */{
206-
_flipX:false,
206+
_flippedX:false,
207207
ctor:function(){
208208
cc.FiniteTimeAction.prototype.ctor.call(this);
209-
this._flipX = false;
209+
this._flippedX = false;
210210
},
211211
/**
212212
* @param {Boolean} x
213213
* @return {Boolean}
214214
*/
215215
initWithFlipX:function (x) {
216-
this._flipX = x;
216+
this._flippedX = x;
217217
return true;
218218
},
219219

220220
/**
221221
* @param {Number} time
222222
*/
223223
update:function (time) {
224-
this._target.setFlipX(this._flipX);
224+
this._target.setFlippedX(this._flippedX);
225225
},
226226

227227
/**
228228
* @return {cc.FiniteTimeAction}
229229
*/
230230
reverse:function () {
231-
return cc.FlipX.create(!this._flipX);
231+
return cc.FlipX.create(!this._flippedX);
232232
},
233233

234234
clone:function(){
235235
var action = new cc.FlipX();
236-
action.initWithFlipX(this._flipX);
236+
action.initWithFlipX(this._flippedX);
237237
return action;
238238
}
239239
});
@@ -256,17 +256,17 @@ cc.FlipX.create = function (x) {
256256
* @extends cc.ActionInstant
257257
*/
258258
cc.FlipY = cc.ActionInstant.extend(/** @lends cc.FlipY# */{
259-
_flipY:false,
259+
_flippedY:false,
260260
ctor:function(){
261261
cc.FiniteTimeAction.prototype.ctor.call(this);
262-
this._flipY = false;
262+
this._flippedY = false;
263263
},
264264
/**
265265
* @param {Boolean} Y
266266
* @return {Boolean}
267267
*/
268268
initWithFlipY:function (Y) {
269-
this._flipY = Y;
269+
this._flippedY = Y;
270270
return true;
271271
},
272272

@@ -275,19 +275,19 @@ cc.FlipY = cc.ActionInstant.extend(/** @lends cc.FlipY# */{
275275
*/
276276
update:function (time) {
277277
//this._super();
278-
this._target.setFlipY(this._flipY);
278+
this._target.setFlippedY(this._flippedY);
279279
},
280280

281281
/**
282282
* @return {cc.FiniteTimeAction}
283283
*/
284284
reverse:function () {
285-
return cc.FlipY.create(!this._flipY);
285+
return cc.FlipY.create(!this._flippedY);
286286
},
287287

288288
clone:function(){
289289
var action = new cc.FlipY();
290-
action.initWithFlipY(this._flipY);
290+
action.initWithFlipY(this._flippedY);
291291
return action;
292292
}
293293
});

cocos2d/layers_scenes_transitions_nodes/CCTransition.js

-6
Original file line numberDiff line numberDiff line change
@@ -277,12 +277,6 @@ cc.TransitionSceneOriented.create = function (t, scene, orientation) {
277277
* @extends cc.TransitionScene
278278
*/
279279
cc.TransitionRotoZoom = cc.TransitionScene.extend(/** @lends cc.TransitionRotoZoom# */{
280-
/**
281-
* Constructor
282-
*/
283-
ctor:function () {
284-
},
285-
286280
/**
287281
* Custom On Enter callback
288282
* @override

cocos2d/layers_scenes_transitions_nodes/CCTransitionPageTurn.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ cc.TransitionPageTurn = cc.TransitionScene.extend(/** @lends cc.TransitionPageTu
5454
// XXX: needed before [super init]
5555
this._back = backwards;
5656

57-
if (cc.TransitionScene.prototype.initWithDuration(this, t, scene)) {
57+
if (cc.TransitionScene.prototype.initWithDuration.call(this, t, scene)) {
5858
// do something
5959
}
6060
return true;

cocos2d/layers_scenes_transitions_nodes/CCTransitionProgress.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ cc.TransitionProgressRadialCCW = cc.TransitionProgress.extend(/** @lends cc.Tran
136136

137137
// but it is flipped upside down so we flip the sprite
138138
if (cc.renderContextType === cc.WEBGL)
139-
pNode.getSprite().setFlipY(true);
139+
pNode.getSprite().setFlippedY(true);
140140
pNode.setType(cc.PROGRESS_TIMER_TYPE_RADIAL);
141141

142142
// Return the radial type that we want to use
@@ -178,7 +178,7 @@ cc.TransitionProgressRadialCW = cc.TransitionProgress.extend(/** @lends cc.Trans
178178

179179
// but it is flipped upside down so we flip the sprite
180180
if (cc.renderContextType === cc.WEBGL)
181-
pNode.getSprite().setFlipY(true);
181+
pNode.getSprite().setFlippedY(true);
182182
pNode.setType(cc.PROGRESS_TIMER_TYPE_RADIAL);
183183

184184
// Return the radial type that we want to use
@@ -219,8 +219,8 @@ cc.TransitionProgressHorizontal = cc.TransitionProgress.extend(/** @lends cc.Tra
219219
var pNode = cc.ProgressTimer.create(texture.getSprite());
220220

221221
// but it is flipped upside down so we flip the sprite
222-
if (cc.renderContextType == cc.WEBGL)
223-
pNode.getSprite().setFlipY(true);
222+
if (cc.renderContextType === cc.WEBGL)
223+
pNode.getSprite().setFlippedY(true);
224224
pNode.setType(cc.PROGRESS_TIMER_TYPE_BAR);
225225

226226
pNode.setMidpoint(cc.p(1, 0));
@@ -261,8 +261,8 @@ cc.TransitionProgressVertical = cc.TransitionProgress.extend(/** @lends cc.Trans
261261
var pNode = cc.ProgressTimer.create(texture.getSprite());
262262

263263
// but it is flipped upside down so we flip the sprite
264-
if (cc.renderContextType == cc.WEBGL)
265-
pNode.getSprite().setFlipY(true);
264+
if (cc.renderContextType === cc.WEBGL)
265+
pNode.getSprite().setFlippedY(true);
266266
pNode.setType(cc.PROGRESS_TIMER_TYPE_BAR);
267267

268268
pNode.setMidpoint(cc.p(0, 0));
@@ -302,8 +302,8 @@ cc.TransitionProgressInOut = cc.TransitionProgress.extend(/** @lends cc.Transiti
302302
var pNode = cc.ProgressTimer.create(texture.getSprite());
303303

304304
// but it is flipped upside down so we flip the sprite
305-
if (cc.renderContextType == cc.WEBGL)
306-
pNode.getSprite().setFlipY(true);
305+
if (cc.renderContextType === cc.WEBGL)
306+
pNode.getSprite().setFlippedY(true);
307307
pNode.setType(cc.PROGRESS_TIMER_TYPE_BAR);
308308

309309
pNode.setMidpoint(cc.p(0.5, 0.5));
@@ -351,8 +351,8 @@ cc.TransitionProgressOutIn = cc.TransitionProgress.extend(/** @lends cc.Transiti
351351
var pNode = cc.ProgressTimer.create(texture.getSprite());
352352

353353
// but it is flipped upside down so we flip the sprite
354-
if (cc.renderContextType == cc.WEBGL)
355-
pNode.getSprite().setFlipY(true);
354+
if (cc.renderContextType === cc.WEBGL)
355+
pNode.getSprite().setFlippedY(true);
356356
pNode.setType(cc.PROGRESS_TIMER_TYPE_BAR);
357357

358358
pNode.setMidpoint(cc.p(0.5, 0.5));

cocos2d/misc_nodes/CCProgressTimer.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -423,11 +423,11 @@ cc.ProgressTimer = cc.NodeRGBA.extend(/** @lends cc.ProgressTimer# */{
423423
var flipXOffset = 0 | (locOffsetPosition.x), flipYOffset = -locOffsetPosition.y - locRect.height;
424424

425425
context.save();
426-
if (locSprite._flipX) {
426+
if (locSprite._flippedX) {
427427
flipXOffset = -locOffsetPosition.x - locRect.width;
428428
context.scale(-1, 1);
429429
}
430-
if (locSprite._flipY) {
430+
if (locSprite._flippedY) {
431431
flipYOffset = locOffsetPosition.y;
432432
context.scale(1, -1);
433433
}
@@ -790,15 +790,15 @@ cc.ProgressTimer = cc.NodeRGBA.extend(/** @lends cc.ProgressTimer# */{
790790
locEndAngle = 270 + 3.6 * this._percentage;
791791
}
792792

793-
if (locSprite._flipX) {
793+
if (locSprite._flippedX) {
794794
locOrigin.x -= spriteSize.width * (this._midPoint.x * 2);
795795
locStartAngle= -locStartAngle;
796796
locEndAngle= -locEndAngle;
797797
locStartAngle -= 180;
798798
locEndAngle -= 180;
799799
locCounterClockWise = !locCounterClockWise;
800800
}
801-
if (locSprite._flipY) {
801+
if (locSprite._flippedY) {
802802
locOrigin.y+=spriteSize.height*(this._midPoint.y*2);
803803
locCounterClockWise = !locCounterClockWise;
804804
locStartAngle= -locStartAngle;
@@ -836,7 +836,7 @@ cc.ProgressTimer = cc.NodeRGBA.extend(/** @lends cc.ProgressTimer# */{
836836
//left pos
837837
locBarRect.x = 0;
838838
var flipXNeed = 1;
839-
if (locSprite._flipX) {
839+
if (locSprite._flippedX) {
840840
locBarRect.x -= currentDrawSize.width;
841841
flipXNeed = -1;
842842
}
@@ -847,7 +847,7 @@ cc.ProgressTimer = cc.NodeRGBA.extend(/** @lends cc.ProgressTimer# */{
847847
//right pos
848848
locBarRect.y = 0;
849849
var flipYNeed = 1;
850-
if (locSprite._flipY) {
850+
if (locSprite._flippedY) {
851851
locBarRect.y += currentDrawSize.height;
852852
flipYNeed = -1;
853853
}

0 commit comments

Comments
 (0)