Skip to content

Commit 4d60352

Browse files
author
SeanLin
committed
Merge pull request cocos2d#510 from linshun/iss1421_beta
issue cocos2d#1421: change cc.WHITE to cc.white, cc.BLACK to cc.black and so on...
2 parents 1fcce9e + 68ff97f commit 4d60352

File tree

15 files changed

+55
-55
lines changed

15 files changed

+55
-55
lines changed

cocos2d/base_nodes/CCAtlasNode.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ cc.AtlasNode = cc.Node.extend(/** @lends cc.AtlasNode# */{
7171
this._itemHeight = tileHeight;
7272

7373
this._opacity = 255;
74-
this._color = cc.WHITE();
75-
this._colorUnmodified = cc.WHITE();
74+
this._color = cc.white();
75+
this._colorUnmodified = cc.white();
7676
this._isOpacityModifyRGB = true;
7777

7878
this._blendFunc.src = cc.BLEND_SRC;

cocos2d/label_nodes/CCLabelBMFont.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ cc.LabelBMFont = cc.SpriteBatchNode.extend(/** @lends cc.LabelBMFont# */{
584584
this._imageOffset = imageOffset || cc.PointZero();
585585
this._width = width || cc.LabelAutomaticWidth;
586586
this._opacity = 255;
587-
this._color = cc.WHITE();
587+
this._color = cc.white();
588588
this._contentSize = cc.SizeZero();
589589
this.setString(theString);
590590
this.setAnchorPoint(cc.p(0.5, 0.5));

cocos2d/label_nodes/CCLabelTTF.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ cc.LabelTTF = cc.Sprite.extend(/** @lends cc.LabelTTF# */{
4545
*/
4646
ctor:function () {
4747
this._super();
48-
this._color = cc.WHITE();
48+
this._color = cc.white();
4949
this._opacityModifyRGB = false;
5050
this._fontStyleStr = "";
5151
},

cocos2d/layers_scenes_transitions_nodes/CCTransition.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1328,7 +1328,7 @@ cc.TransitionFade = cc.TransitionScene.extend(/** @lends cc.TransitionFade# */{
13281328
*/
13291329
initWithDuration:function (t, scene, color) {
13301330
if ((color == 'undefined') || (color == null)) {
1331-
color = cc.BLACK();
1331+
color = cc.black();
13321332
}
13331333

13341334
if (this._super(t, scene)) {

cocos2d/menu_nodes/CCMenuItem.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ cc.MenuItemLabel = cc.MenuItem.extend(/** @lends cc.MenuItemLabel# */{
292292
initWithLabel:function (label, target, selector) {
293293
this.initWithCallback(target, selector);
294294
this._originalScale = 1.0;
295-
this._colorBackup = cc.WHITE();
295+
this._colorBackup = cc.white();
296296
this._disabledColor = cc.c3b(126, 126, 126);
297297
this.setLabel(label);
298298
return true;

cocos2d/platform/CCTypes.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ cc.c3 = cc.c3b;
9191
* @constant
9292
* @type {Number,Number,Number}
9393
*/
94-
cc.WHITE = function () {
94+
cc.white = function () {
9595
return new cc.Color3B(255, 255, 255);
9696
};
9797

@@ -100,7 +100,7 @@ cc.WHITE = function () {
100100
* @constant
101101
* @type {Number,Number,Number}
102102
*/
103-
cc.YELLOW = function () {
103+
cc.yellow = function () {
104104
return new cc.Color3B(255, 255, 0);
105105
};
106106

@@ -109,7 +109,7 @@ cc.YELLOW = function () {
109109
* @constant
110110
* @type {Number,Number,Number}
111111
*/
112-
cc.BLUE = function () {
112+
cc.blue = function () {
113113
return new cc.Color3B(0, 0, 255);
114114
};
115115

@@ -118,7 +118,7 @@ cc.BLUE = function () {
118118
* @constant
119119
* @type {Number,Number,Number}
120120
*/
121-
cc.GREEN = function () {
121+
cc.green = function () {
122122
return new cc.Color3B(0, 255, 0);
123123
};
124124

@@ -127,7 +127,7 @@ cc.GREEN = function () {
127127
* @constant
128128
* @type {Number,Number,Number}
129129
*/
130-
cc.RED = function () {
130+
cc.red = function () {
131131
return new cc.Color3B(255, 0, 0);
132132
};
133133

@@ -136,7 +136,7 @@ cc.RED = function () {
136136
* @constant
137137
* @type {Number,Number,Number}
138138
*/
139-
cc.MAGENTA = function () {
139+
cc.magenta = function () {
140140
return new cc.Color3B(255, 0, 255);
141141
};
142142

@@ -145,7 +145,7 @@ cc.MAGENTA = function () {
145145
* @constant
146146
* @type {Number,Number,Number}
147147
*/
148-
cc.BLACK = function () {
148+
cc.black = function () {
149149
return new cc.Color3B(0, 0, 0);
150150
};
151151

@@ -154,7 +154,7 @@ cc.BLACK = function () {
154154
* @constant
155155
* @type {Number,Number,Number}
156156
*/
157-
cc.ORANGE = function () {
157+
cc.orange = function () {
158158
return new cc.Color3B(255, 127, 0);
159159
};
160160

@@ -163,7 +163,7 @@ cc.ORANGE = function () {
163163
* @constant
164164
* @type {Number,Number,Number}
165165
*/
166-
cc.GRAY = function () {
166+
cc.gray = function () {
167167
return new cc.Color3B(166, 166, 166);
168168
}
169169

cocos2d/sprite_nodes/CCSprite.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ cc.Sprite = cc.Node.extend(/** @lends cc.Sprite# */{
248248
_blendFunc: {src:cc.BLEND_SRC, dst:cc.BLEND_DST},
249249
_texture:null,
250250
_originalTexture:null,
251-
_color:cc.WHITE(),
251+
_color:cc.white(),
252252
//
253253
// Shared data
254254
//
@@ -434,8 +434,8 @@ cc.Sprite = cc.Node.extend(/** @lends cc.Sprite# */{
434434

435435
this._opacityModifyRGB = true;
436436
this._opacity = 255;
437-
this._color = cc.WHITE();
438-
this._colorUnmodified = cc.WHITE();
437+
this._color = cc.white();
438+
this._colorUnmodified = cc.white();
439439

440440
this._blendFunc.src = cc.BLEND_SRC;
441441
this._blendFunc.dst = cc.BLEND_DST;
@@ -491,8 +491,8 @@ cc.Sprite = cc.Node.extend(/** @lends cc.Sprite# */{
491491
this.setDirty(false);
492492
this._opacityModifyRGB = true;
493493
this._opacity = 255;
494-
this._color = cc.WHITE();
495-
this._colorUnmodified = cc.WHITE();
494+
this._color = cc.white();
495+
this._colorUnmodified = cc.white();
496496

497497
this._blendFunc.src = cc.BLEND_SRC;
498498
this._blendFunc.dst = cc.BLEND_DST;

cocos2d/tileMap_parallax_nodes/CCTileMapAtlas.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ cc.TileMapAtlas = cc.AtlasNode.extend(/** @lends cc.TileMapAtlas# */{
129129
this._loadTGAfile(mapFile);
130130
this._calculateItemsToRender();
131131
if (this.initWithTileFile(tile, tileWidth, tileHeight, this._itemsToRender)) {
132-
this._color = cc.WHITE();
132+
this._color = cc.white();
133133
this._posToAtlasIndex = new Object();
134134
this._updateAtlasValues();
135135
this.setContentSize(cc.size((this._GAInfo.width * this._itemWidth),

tests/src/tests/ActionsTest/ActionsTest.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ var ActionManual = ActionsDemo.extend({
293293
this._grossini.setColor(cc.c3b(255, 0, 0));
294294

295295
this._kathia.setPosition(cc.p(s.width - 100, s.height / 2));
296-
this._kathia.setColor(cc.BLUE());
296+
this._kathia.setColor(cc.blue());
297297
},
298298
subtitle:function () {
299299
return "Manual Transformation";

tests/src/tests/CocosNodeTest/CocosNodeTest.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ var CameraCenterTest = TestCocosNodeDemo.extend({
532532
sprite.init();
533533
this.addChild(sprite, 0);
534534
sprite.setPosition(cc.p(s.width / 5 * 1, s.height / 5 * 1));
535-
sprite.setColor(cc.RED());
535+
sprite.setColor(cc.red());
536536
sprite.setTextureRect(cc.rect(0, 0, 120, 50));
537537
var orbit = cc.OrbitCamera.create(10, 1, 0, 0, 360, 0, 0);
538538
sprite.runAction(cc.RepeatForever.create(orbit));
@@ -542,7 +542,7 @@ var CameraCenterTest = TestCocosNodeDemo.extend({
542542
sprite.init();
543543
this.addChild(sprite, 0, 40);
544544
sprite.setPosition(cc.p(s.width / 5 * 1, s.height / 5 * 4));
545-
sprite.setColor(cc.BLUE());
545+
sprite.setColor(cc.blue());
546546
sprite.setTextureRect(cc.rect(0, 0, 120, 50));
547547
orbit = cc.OrbitCamera.create(10, 1, 0, 0, 360, 0, 0);
548548
sprite.runAction(cc.RepeatForever.create(orbit));
@@ -552,7 +552,7 @@ var CameraCenterTest = TestCocosNodeDemo.extend({
552552
sprite.init();
553553
this.addChild(sprite, 0);
554554
sprite.setPosition(cc.p(s.width / 5 * 4, s.height / 5 * 1));
555-
sprite.setColor(cc.YELLOW());
555+
sprite.setColor(cc.yellow());
556556
sprite.setTextureRect(cc.rect(0, 0, 120, 50));
557557
orbit = cc.OrbitCamera.create(10, 1, 0, 0, 360, 0, 0);
558558
sprite.runAction(cc.RepeatForever.create(orbit));
@@ -562,7 +562,7 @@ var CameraCenterTest = TestCocosNodeDemo.extend({
562562
sprite.init();
563563
this.addChild(sprite, 0, 40);
564564
sprite.setPosition(cc.p(s.width / 5 * 4, s.height / 5 * 4));
565-
sprite.setColor(cc.GREEN());
565+
sprite.setColor(cc.green());
566566
sprite.setTextureRect(cc.rect(0, 0, 120, 50));
567567
orbit = cc.OrbitCamera.create(10, 1, 0, 0, 360, 0, 0);
568568
sprite.runAction(cc.RepeatForever.create(orbit));
@@ -572,7 +572,7 @@ var CameraCenterTest = TestCocosNodeDemo.extend({
572572
sprite.init();
573573
this.addChild(sprite, 0, 40);
574574
sprite.setPosition(cc.p(s.width / 2, s.height / 2));
575-
sprite.setColor(cc.WHITE());
575+
sprite.setColor(cc.white());
576576
sprite.setTextureRect(cc.rect(0, 0, 120, 50));
577577
orbit = cc.OrbitCamera.create(10, 1, 0, 0, 360, 0, 0);
578578
sprite.runAction(cc.RepeatForever.create(orbit));

0 commit comments

Comments
 (0)