From d706ad6fcfd290518456346d7f4b6b0199bc62e1 Mon Sep 17 00:00:00 2001 From: zilongshanren Date: Tue, 27 Jun 2017 14:36:30 +0800 Subject: [PATCH] fix jsb bmfont loader --- cocos2d/core/components/CCLabel.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cocos2d/core/components/CCLabel.js b/cocos2d/core/components/CCLabel.js index 2b06739073..25bc0a1ca1 100644 --- a/cocos2d/core/components/CCLabel.js +++ b/cocos2d/core/components/CCLabel.js @@ -404,10 +404,10 @@ var Label = cc.Class({ if (font instanceof cc.BitmapFont) { if (font.spriteFrame) { if (!CC_JSB) { - this._sgNode.setFontFileOrFamily(font.fntDataStr, font.spriteFrame, font); + this._sgNode.setFontFileOrFamily("", font.spriteFrame, font); } else { if (font.spriteFrame.textureLoaded()) { - this._sgNode.setFontFileOrFamily(font.fntDataStr, font.spriteFrame); + this._sgNode.setFontFileOrFamily(JSON.stringify(font._fntConfig), font.spriteFrame); } else { cc.warnID(4012, font.name); @@ -528,13 +528,13 @@ var Label = cc.Class({ if (font.spriteFrame) { if (CC_JSB) { if (font.spriteFrame.textureLoaded()) { - sgNode = this._sgNode = new _ccsg.Label(this.string, font.fntDataStr, font.spriteFrame); + sgNode = this._sgNode = new _ccsg.Label(this.string, JSON.stringify(font._fntConfig), font.spriteFrame); } else { cc.warnID(4012, font.name); sgNode = this._sgNode = new _ccsg.Label(this.string); } } else { - sgNode = this._sgNode = new _ccsg.Label(this.string, font.fntDataStr, font.spriteFrame, font); + sgNode = this._sgNode = new _ccsg.Label(this.string, "", font.spriteFrame, font); } } else { cc.warnID(4011, font.name);