Skip to content

Commit da87a4b

Browse files
committed
fix bmfont update logic
1 parent c30a2e6 commit da87a4b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

cocos2d/labels/CCLabelBMFont.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,11 @@ cc.LabelBMFont = cc.Node.extend(/** @lends cc.LabelBMFont# */{
114114
},
115115

116116
_setString: function (newString, needUpdateLabel) {
117-
this._initialString = newString;
118-
this._string = newString;
117+
if (!needUpdateLabel) {
118+
this._string = newString;
119+
} else {
120+
this._initialString = newString;
121+
}
119122

120123
var locChildren = this._children;
121124
if (locChildren) {
@@ -561,7 +564,8 @@ cc.LabelBMFont = cc.Node.extend(/** @lends cc.LabelBMFont# */{
561564
*/
562565
updateLabel: function () {
563566
var self = this;
564-
self._string = self._initialString;
567+
self.string = self._initialString;
568+
565569
var i, j, characterSprite;
566570
// process string
567571
// Step 1: Make multiline

0 commit comments

Comments
 (0)