Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cocos2d/base_nodes/CCAtlasNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ cc.AtlasNode = cc.Node.extend(/** @lends cc.AtlasNode# */{
this._itemHeight = tileHeight;

this._opacity = 255;
this._color = cc.WHITE();
this._colorUnmodified = cc.WHITE();
this._color = cc.white();
this._colorUnmodified = cc.white();
this._isOpacityModifyRGB = true;

this._blendFunc.src = cc.BLEND_SRC;
Expand Down
2 changes: 1 addition & 1 deletion cocos2d/label_nodes/CCLabelBMFont.js
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ cc.LabelBMFont = cc.SpriteBatchNode.extend(/** @lends cc.LabelBMFont# */{
this._imageOffset = imageOffset || cc.PointZero();
this._width = width || cc.LabelAutomaticWidth;
this._opacity = 255;
this._color = cc.WHITE();
this._color = cc.white();
this._contentSize = cc.SizeZero();
this.setString(theString);
this.setAnchorPoint(cc.p(0.5, 0.5));
Expand Down
2 changes: 1 addition & 1 deletion cocos2d/label_nodes/CCLabelTTF.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ cc.LabelTTF = cc.Sprite.extend(/** @lends cc.LabelTTF# */{
*/
ctor:function () {
this._super();
this._color = cc.WHITE();
this._color = cc.white();
this._opacityModifyRGB = false;
this._fontStyleStr = "";
},
Expand Down
2 changes: 1 addition & 1 deletion cocos2d/layers_scenes_transitions_nodes/CCTransition.js
Original file line number Diff line number Diff line change
Expand Up @@ -1328,7 +1328,7 @@ cc.TransitionFade = cc.TransitionScene.extend(/** @lends cc.TransitionFade# */{
*/
initWithDuration:function (t, scene, color) {
if ((color == 'undefined') || (color == null)) {
color = cc.BLACK();
color = cc.black();
}

if (this._super(t, scene)) {
Expand Down
2 changes: 1 addition & 1 deletion cocos2d/menu_nodes/CCMenuItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ cc.MenuItemLabel = cc.MenuItem.extend(/** @lends cc.MenuItemLabel# */{
initWithLabel:function (label, target, selector) {
this.initWithCallback(target, selector);
this._originalScale = 1.0;
this._colorBackup = cc.WHITE();
this._colorBackup = cc.white();
this._disabledColor = cc.c3b(126, 126, 126);
this.setLabel(label);
return true;
Expand Down
18 changes: 9 additions & 9 deletions cocos2d/platform/CCTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ cc.c3 = cc.c3b;
* @constant
* @type {Number,Number,Number}
*/
cc.WHITE = function () {
cc.white = function () {
return new cc.Color3B(255, 255, 255);
};

Expand All @@ -100,7 +100,7 @@ cc.WHITE = function () {
* @constant
* @type {Number,Number,Number}
*/
cc.YELLOW = function () {
cc.yellow = function () {
return new cc.Color3B(255, 255, 0);
};

Expand All @@ -109,7 +109,7 @@ cc.YELLOW = function () {
* @constant
* @type {Number,Number,Number}
*/
cc.BLUE = function () {
cc.blue = function () {
return new cc.Color3B(0, 0, 255);
};

Expand All @@ -118,7 +118,7 @@ cc.BLUE = function () {
* @constant
* @type {Number,Number,Number}
*/
cc.GREEN = function () {
cc.green = function () {
return new cc.Color3B(0, 255, 0);
};

Expand All @@ -127,7 +127,7 @@ cc.GREEN = function () {
* @constant
* @type {Number,Number,Number}
*/
cc.RED = function () {
cc.red = function () {
return new cc.Color3B(255, 0, 0);
};

Expand All @@ -136,7 +136,7 @@ cc.RED = function () {
* @constant
* @type {Number,Number,Number}
*/
cc.MAGENTA = function () {
cc.magenta = function () {
return new cc.Color3B(255, 0, 255);
};

Expand All @@ -145,7 +145,7 @@ cc.MAGENTA = function () {
* @constant
* @type {Number,Number,Number}
*/
cc.BLACK = function () {
cc.black = function () {
return new cc.Color3B(0, 0, 0);
};

Expand All @@ -154,7 +154,7 @@ cc.BLACK = function () {
* @constant
* @type {Number,Number,Number}
*/
cc.ORANGE = function () {
cc.orange = function () {
return new cc.Color3B(255, 127, 0);
};

Expand All @@ -163,7 +163,7 @@ cc.ORANGE = function () {
* @constant
* @type {Number,Number,Number}
*/
cc.GRAY = function () {
cc.gray = function () {
return new cc.Color3B(166, 166, 166);
}

Expand Down
10 changes: 5 additions & 5 deletions cocos2d/sprite_nodes/CCSprite.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ cc.Sprite = cc.Node.extend(/** @lends cc.Sprite# */{
_blendFunc: {src:cc.BLEND_SRC, dst:cc.BLEND_DST},
_texture:null,
_originalTexture:null,
_color:cc.WHITE(),
_color:cc.white(),
//
// Shared data
//
Expand Down Expand Up @@ -434,8 +434,8 @@ cc.Sprite = cc.Node.extend(/** @lends cc.Sprite# */{

this._opacityModifyRGB = true;
this._opacity = 255;
this._color = cc.WHITE();
this._colorUnmodified = cc.WHITE();
this._color = cc.white();
this._colorUnmodified = cc.white();

this._blendFunc.src = cc.BLEND_SRC;
this._blendFunc.dst = cc.BLEND_DST;
Expand Down Expand Up @@ -491,8 +491,8 @@ cc.Sprite = cc.Node.extend(/** @lends cc.Sprite# */{
this.setDirty(false);
this._opacityModifyRGB = true;
this._opacity = 255;
this._color = cc.WHITE();
this._colorUnmodified = cc.WHITE();
this._color = cc.white();
this._colorUnmodified = cc.white();

this._blendFunc.src = cc.BLEND_SRC;
this._blendFunc.dst = cc.BLEND_DST;
Expand Down
2 changes: 1 addition & 1 deletion cocos2d/tileMap_parallax_nodes/CCTileMapAtlas.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ cc.TileMapAtlas = cc.AtlasNode.extend(/** @lends cc.TileMapAtlas# */{
this._loadTGAfile(mapFile);
this._calculateItemsToRender();
if (this.initWithTileFile(tile, tileWidth, tileHeight, this._itemsToRender)) {
this._color = cc.WHITE();
this._color = cc.white();
this._posToAtlasIndex = new Object();
this._updateAtlasValues();
this.setContentSize(cc.size((this._GAInfo.width * this._itemWidth),
Expand Down
2 changes: 1 addition & 1 deletion tests/src/tests/ActionsTest/ActionsTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ var ActionManual = ActionsDemo.extend({
this._grossini.setColor(cc.c3b(255, 0, 0));

this._kathia.setPosition(cc.p(s.width - 100, s.height / 2));
this._kathia.setColor(cc.BLUE());
this._kathia.setColor(cc.blue());
},
subtitle:function () {
return "Manual Transformation";
Expand Down
10 changes: 5 additions & 5 deletions tests/src/tests/CocosNodeTest/CocosNodeTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ var CameraCenterTest = TestCocosNodeDemo.extend({
sprite.init();
this.addChild(sprite, 0);
sprite.setPosition(cc.p(s.width / 5 * 1, s.height / 5 * 1));
sprite.setColor(cc.RED());
sprite.setColor(cc.red());
sprite.setTextureRect(cc.rect(0, 0, 120, 50));
var orbit = cc.OrbitCamera.create(10, 1, 0, 0, 360, 0, 0);
sprite.runAction(cc.RepeatForever.create(orbit));
Expand All @@ -542,7 +542,7 @@ var CameraCenterTest = TestCocosNodeDemo.extend({
sprite.init();
this.addChild(sprite, 0, 40);
sprite.setPosition(cc.p(s.width / 5 * 1, s.height / 5 * 4));
sprite.setColor(cc.BLUE());
sprite.setColor(cc.blue());
sprite.setTextureRect(cc.rect(0, 0, 120, 50));
orbit = cc.OrbitCamera.create(10, 1, 0, 0, 360, 0, 0);
sprite.runAction(cc.RepeatForever.create(orbit));
Expand All @@ -552,7 +552,7 @@ var CameraCenterTest = TestCocosNodeDemo.extend({
sprite.init();
this.addChild(sprite, 0);
sprite.setPosition(cc.p(s.width / 5 * 4, s.height / 5 * 1));
sprite.setColor(cc.YELLOW());
sprite.setColor(cc.yellow());
sprite.setTextureRect(cc.rect(0, 0, 120, 50));
orbit = cc.OrbitCamera.create(10, 1, 0, 0, 360, 0, 0);
sprite.runAction(cc.RepeatForever.create(orbit));
Expand All @@ -562,7 +562,7 @@ var CameraCenterTest = TestCocosNodeDemo.extend({
sprite.init();
this.addChild(sprite, 0, 40);
sprite.setPosition(cc.p(s.width / 5 * 4, s.height / 5 * 4));
sprite.setColor(cc.GREEN());
sprite.setColor(cc.green());
sprite.setTextureRect(cc.rect(0, 0, 120, 50));
orbit = cc.OrbitCamera.create(10, 1, 0, 0, 360, 0, 0);
sprite.runAction(cc.RepeatForever.create(orbit));
Expand All @@ -572,7 +572,7 @@ var CameraCenterTest = TestCocosNodeDemo.extend({
sprite.init();
this.addChild(sprite, 0, 40);
sprite.setPosition(cc.p(s.width / 2, s.height / 2));
sprite.setColor(cc.WHITE());
sprite.setColor(cc.white());
sprite.setTextureRect(cc.rect(0, 0, 120, 50));
orbit = cc.OrbitCamera.create(10, 1, 0, 0, 360, 0, 0);
sprite.runAction(cc.RepeatForever.create(orbit));
Expand Down
26 changes: 13 additions & 13 deletions tests/src/tests/LabelTest/LabelTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ var LabelAtlasColorTest = AtlasDemo.extend({
var label2 = cc.LabelAtlas.create("0123456789", "res/fonts/tuffy_bold_italic-charmap.png", 48, 64, ' ');
this.addChild(label2, 0, TAG_LABEL_SPRITE12);
label2.setPosition(cc.p(10, 200));
label2.setColor(cc.RED());
label2.setColor(cc.red());

var fade = cc.FadeOut.create(1.0);
var fade_in = fade.reverse();
Expand Down Expand Up @@ -373,7 +373,7 @@ var Atlas3 = AtlasDemo.extend({
var label2 = cc.LabelBMFont.create("Test", "res/fonts/bitmapFontTest2.fnt");
// testing anchors
label2.setAnchorPoint(cc.p(0.5, 0.5));
label2.setColor(cc.RED());
label2.setColor(cc.red());
this.addChild(label2, 0, TAG_BITMAP_ATLAS2);
label2.runAction(repeat.copy());

Expand Down Expand Up @@ -477,7 +477,7 @@ var Atlas4 = AtlasDemo.extend({
},
draw:function () {
var s = cc.Director.getInstance().getWinSize();
var c = cc.RED();
var c = cc.red();
cc.renderContext.strokeStyle = "rgba(" + c.r + "," + c.g + "," + c.b + ",1)";
cc.drawingUtil.drawLine(cc.p(0, s.height / 2), cc.p(s.width, s.height / 2));
cc.drawingUtil.drawLine(cc.p(s.width / 2, 0), cc.p(s.width / 2, s.height));
Expand Down Expand Up @@ -564,7 +564,7 @@ var AtlasBitmapColor = AtlasDemo.extend({

var label = null;
label = cc.LabelBMFont.create("Blue", "res/fonts/bitmapFontTest5.fnt");
label.setColor(cc.BLUE());
label.setColor(cc.blue());
this.addChild(label);
label.setPosition(cc.p(s.width / 2, s.height / 4));
label.setAnchorPoint(cc.p(0.5, 0.5));
Expand All @@ -573,13 +573,13 @@ var AtlasBitmapColor = AtlasDemo.extend({
this.addChild(label);
label.setPosition(cc.p(s.width / 2, 2 * s.height / 4));
label.setAnchorPoint(cc.p(0.5, 0.5));
label.setColor(cc.RED());
label.setColor(cc.red());

label = cc.LabelBMFont.create("G", "res/fonts/bitmapFontTest5.fnt");
this.addChild(label);
label.setPosition(cc.p(s.width / 2, 3 * s.height / 4));
label.setAnchorPoint(cc.p(0.5, 0.5));
label.setColor(cc.GREEN());
label.setColor(cc.green());
label.setString("Green");
},
title:function () {
Expand Down Expand Up @@ -999,7 +999,7 @@ var BitmapFontMultiLineAlignment = AtlasDemo.extend({
var stringMenu = cc.Menu.create(longSentences, lineBreaks, mixed);
stringMenu.alignItemsVertically();

longSentences.setColor(cc.RED());
longSentences.setColor(cc.red());
this.lastSentenceItem = longSentences;
longSentences.setTag(LongSentences);
lineBreaks.setTag(LineBreaks);
Expand All @@ -1013,7 +1013,7 @@ var BitmapFontMultiLineAlignment = AtlasDemo.extend({
var alignmentMenu = cc.Menu.create(left, center, right);
alignmentMenu.alignItemsHorizontallyWithPadding(alignmentItemPadding);

center.setColor(cc.RED());
center.setColor(cc.red());
this.lastAlignmentItem = center;
left.setTag(LeftAlign);
center.setTag(CenterAlign);
Expand Down Expand Up @@ -1046,8 +1046,8 @@ var BitmapFontMultiLineAlignment = AtlasDemo.extend({
return "";
},
stringChanged:function (sender) {
sender.setColor(cc.RED());
this.lastSentenceItem.setColor(cc.WHITE());
sender.setColor(cc.red());
this.lastSentenceItem.setColor(cc.white());
this.lastSentenceItem = sender;

switch (sender.getTag()) {
Expand All @@ -1069,8 +1069,8 @@ var BitmapFontMultiLineAlignment = AtlasDemo.extend({
},
alignmentChanged:function (sender) {
var item = sender;
item.setColor(cc.RED());
this.lastAlignmentItem.setColor(cc.WHITE());
item.setColor(cc.red());
this.lastAlignmentItem.setColor(cc.white());
this.lastAlignmentItem = item;

switch (item.getTag()) {
Expand Down Expand Up @@ -1138,7 +1138,7 @@ var LabelTTFA8Test = AtlasDemo.extend({
// cc.LabelBMFont
var label1 = cc.LabelTTF.create("Testing A8 Format", "Arial", 48);
this.addChild(label1);
label1.setColor(cc.RED());
label1.setColor(cc.red());
label1.setPosition(cc.p(s.width / 2, s.height / 2));

var fadeOut = cc.FadeOut.create(2);
Expand Down
10 changes: 5 additions & 5 deletions tests/src/tests/MultiTouchTest/MultiTouchTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
****************************************************************************/

var touchColors = [
cc.YELLOW(),
cc.BLUE(),
cc.GREEN(),
cc.RED(),
cc.MAGENTA()
cc.yellow(),
cc.blue(),
cc.green(),
cc.red(),
cc.magenta()
];

var TouchPoint = cc.Node.extend({
Expand Down
10 changes: 5 additions & 5 deletions tests/src/tests/ParticleTest/ParticleTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@ var DemoParticleFromFile = ParticleDemo.extend({
onEnter:function () {
this._super();

this.setColor(cc.BLACK());
this.setColor(cc.black());
this.removeChild(this._background, true);
this._background = null;

Expand All @@ -885,7 +885,7 @@ var RadiusMode1 = ParticleDemo.extend({
onEnter:function () {
this._super();

this.setColor(cc.BLACK());
this.setColor(cc.black());
this.removeChild(this._background, true);
this._background = null;

Expand Down Expand Up @@ -964,7 +964,7 @@ var RadiusMode2 = ParticleDemo.extend({
onEnter:function () {
this._super();

this.setColor(cc.BLACK());
this.setColor(cc.black());
this.removeChild(this._background, true);
this._background = null;

Expand Down Expand Up @@ -1043,7 +1043,7 @@ var Issue704 = ParticleDemo.extend({
onEnter:function () {
this._super();

this.setColor(cc.BLACK());
this.setColor(cc.black());
this.removeChild(this._background, true);
this._background = null;

Expand Down Expand Up @@ -1128,7 +1128,7 @@ var Issue870 = ParticleDemo.extend({
onEnter:function () {
this._super();

this.setColor(cc.BLACK());
this.setColor(cc.black());
this.removeChild(this._background, true);
this._background = null;

Expand Down
Loading