@@ -294,12 +294,12 @@ cc.LabelBMFont = cc.SpriteBatchNode.extend(/** @lends cc.LabelBMFont# */{
294294 */
295295 updateDisplayedOpacity : function ( parentOpacity ) {
296296 var cmd = this . _renderCmd ;
297- this . _displayedOpacity = this . _realOpacity * parentOpacity / 255.0 ;
298- var locChildren = this . _children ;
299- for ( var i = 0 ; i < locChildren . length ; i ++ ) {
300- cmd . _updateChildrenDisplayedOpacity ( locChildren [ i ] ) ;
301- }
302- this . _changeTextureColor ( ) ;
297+ cmd . _displayedOpacity = this . _realOpacity * parentOpacity / 255.0 ;
298+ // var locChildren = this._children;
299+ // for (var i = 0; i < locChildren.length; i++) {
300+ // cmd._updateChildrenDisplayedOpacity(locChildren[i]);
301+ // }
302+ // this._changeTextureColor();
303303 } ,
304304
305305 /**
@@ -345,17 +345,17 @@ cc.LabelBMFont = cc.SpriteBatchNode.extend(/** @lends cc.LabelBMFont# */{
345345 */
346346 updateDisplayedColor : function ( parentColor ) {
347347 var cmd = this . _renderCmd ;
348- var locDispColor = this . _displayedColor ;
348+ var locDispColor = cmd . _displayedColor ;
349349 var locRealColor = this . _realColor ;
350350 locDispColor . r = locRealColor . r * parentColor . r / 255.0 ;
351351 locDispColor . g = locRealColor . g * parentColor . g / 255.0 ;
352352 locDispColor . b = locRealColor . b * parentColor . b / 255.0 ;
353353
354- var locChildren = this . _children ;
355- for ( var i = 0 ; i < locChildren . length ; i ++ ) {
356- cmd . _updateChildrenDisplayedColor ( locChildren [ i ] ) ;
357- }
358- this . _changeTextureColor ( ) ;
354+ // var locChildren = this._children;
355+ // for (var i = 0; i < locChildren.length; i++) {
356+ // cmd._updateChildrenDisplayedColor(locChildren[i]);
357+ // }
358+ // this._changeTextureColor();
359359 } ,
360360
361361 _changeTextureColor : function ( ) {
@@ -440,8 +440,8 @@ cc.LabelBMFont = cc.SpriteBatchNode.extend(/** @lends cc.LabelBMFont# */{
440440 cmd . _displayedOpacity = self . _realOpacity = 255 ;
441441 cmd . _displayedColor = cc . color ( 255 , 255 , 255 , 255 ) ;
442442 self . _realColor = cc . color ( 255 , 255 , 255 , 255 ) ;
443- self . _cascadeOpacityEnabled = true ;
444- self . _cascadeColorEnabled = true ;
443+ this . _cascadeColorEnabled = true ;
444+ this . _cascadeOpacityEnabled = true ;
445445
446446 self . _contentSize . width = 0 ;
447447 self . _contentSize . height = 0 ;
@@ -513,7 +513,18 @@ cc.LabelBMFont = cc.SpriteBatchNode.extend(/** @lends cc.LabelBMFont# */{
513513
514514 var fontChar = self . getChildByTag ( i ) ;
515515
516- fontChar = this . _renderCmd . _updateTexture ( fontChar , locTexture , rect , i , key ) ;
516+ if ( ! fontChar ) {
517+ fontChar = new cc . Sprite ( ) ;
518+ fontChar . initWithTexture ( locTexture , rect , false ) ;
519+ fontChar . _newTextureWhenChangeColor = true ;
520+ this . addChild ( fontChar , 0 , i ) ;
521+ } else {
522+ this . _renderCmd . _updateCharTexture ( fontChar , rect , key ) ;
523+ }
524+
525+ // Apply label properties
526+ fontChar . opacityModifyRGB = this . _opacityModifyRGB ;
527+ this . _renderCmd . _updateCharColorAndOpacity ( fontChar ) ;
517528
518529 var yOffset = locCfg . commonHeight - fontDef . yOffset ;
519530 var fontPos = cc . p ( nextFontPositionX + fontDef . xOffset + fontDef . rect . width * 0.5 + kerningAmount ,
@@ -1000,18 +1011,20 @@ cc.LabelBMFont = cc.SpriteBatchNode.extend(/** @lends cc.LabelBMFont# */{
10001011 }
10011012} ) ;
10021013
1003- var _p = cc . LabelBMFont . prototype ;
1004- cc . EventHelper . prototype . apply ( _p ) ;
1005-
1006- /** @expose */
1007- _p . string ;
1008- cc . defineGetterSetter ( _p , "string" , _p . getString , _p . _setStringForSetter ) ;
1009- /** @expose */
1010- _p . boundingWidth ;
1011- cc . defineGetterSetter ( _p , "boundingWidth" , _p . _getBoundingWidth , _p . setBoundingWidth ) ;
1012- /** @expose */
1013- _p . textAlign ;
1014- cc . defineGetterSetter ( _p , "textAlign" , _p . _getAlignment , _p . setAlignment ) ;
1014+ ( function ( ) {
1015+ var p = cc . LabelBMFont . prototype ;
1016+ cc . EventHelper . prototype . apply ( p ) ;
1017+
1018+ /** @expose */
1019+ p . string ;
1020+ cc . defineGetterSetter ( p , "string" , p . getString , p . _setStringForSetter ) ;
1021+ /** @expose */
1022+ p . boundingWidth ;
1023+ cc . defineGetterSetter ( p , "boundingWidth" , p . _getBoundingWidth , p . setBoundingWidth ) ;
1024+ /** @expose */
1025+ p . textAlign ;
1026+ cc . defineGetterSetter ( p , "textAlign" , p . _getAlignment , p . setAlignment ) ;
1027+ } ) ( ) ;
10151028
10161029/**
10171030 * creates a bitmap font atlas with an initial string and the FNT file
0 commit comments