Skip to content
Merged
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
10 changes: 8 additions & 2 deletions cocos2d/labels/CCLabelAtlas.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,11 @@ cc.LabelAtlas = cc.AtlasNode.extend(/** @lends cc.LabelAtlas# */{
}
},

_addChildForCanvas: function(child, zOrder, tag){
child._lateChild = true;
cc.NodeRGBA.prototype.addChild.call(this, child, zOrder, tag);
},

/**
* @function
* Atlas generation
Expand Down Expand Up @@ -210,7 +215,7 @@ cc.LabelAtlas = cc.AtlasNode.extend(/** @lends cc.LabelAtlas# */{
} else
fontChar.initWithTexture(texture, rect);

this.addChild(fontChar, 0, i);
cc.NodeRGBA.prototype.addChild.call(this, fontChar, 0, i);
} else {
if (c == 32) {
fontChar.init();
Expand Down Expand Up @@ -319,7 +324,7 @@ cc.LabelAtlas = cc.AtlasNode.extend(/** @lends cc.LabelAtlas# */{
len = locChildren.length;
for (var i = 0; i < len; i++) {
var node = locChildren[i];
if (node)
if (node && !node._lateChild)
node.visible = false;
}
}
Expand Down Expand Up @@ -370,6 +375,7 @@ if (cc._renderType === cc._RENDER_TYPE_WEBGL) {
_p.updateAtlasValues = _p._updateAtlasValuesForCanvas;
_p.setString = _p._setStringForCanvas;
_p.setOpacity = _p._setOpacityForCanvas;
_p.addChild = _p._addChildForCanvas;
}

// Override properties
Expand Down