Skip to content

Commit e25c9ee

Browse files
committed
Merge pull request cocos2d#3185 from pandamicro/develop
Fix text color parser for TextField widget
2 parents 252109c + 7bf9074 commit e25c9ee

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

cocos2d/actions/CCActionInstant.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ cc.CallFunc = cc.ActionInstant.extend(/** @lends cc.CallFunc# */{
660660
if (selectorTarget) {
661661
this._selectorTarget = selectorTarget;
662662
}
663-
if (data) {
663+
if (data !== undefined) {
664664
this._data = data;
665665
}
666666
return true;

extensions/cocostudio/loader/parsers/uiParser-1.x.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,13 @@
662662
var va = options["vAlignment"];
663663
if(va)
664664
widget.setTextVerticalAlignment(va);
665+
666+
var r = options["colorR"];
667+
var g = options["colorG"];
668+
var b = options["colorB"];
669+
if (r !== undefined && g !== undefined && b !== undefined) {
670+
widget.setTextColor(cc.color(r, g, b));
671+
}
665672
};
666673

667674
var register = [

0 commit comments

Comments
 (0)