cocos2dx-js解析cocostudio生成的 textatlas字体有错误,修改{project}/frameworks\cocos2d-x\cocos\scripting\js-bindings\script\studio\parsers\timelineParser-2.x.js文件中的parser.initTextAtlas方法。修改为
/**
* TextAtlas
* @param json
* @param resourcePath
* @returns {ccui.TextAtlas}
*/
parser.initTextAtlas = function(json, resourcePath){
var widget = new ccui.TextAtlas();
this.widgetAttributes(widget, json);
var stringValue = json"LabelText"];
var itemWidth = json"CharWidth"];
var itemHeight = json"CharHeight"];
var startCharMap = json"StartChar"];
loadTexture(json"LabelAtlasFileImage_CNB"], resourcePath, function(path, type){
if(type === 0){
widget.setProperty(stringValue, path, itemWidth, itemHeight, startCharMap);
}
});
widget.ignoreContentAdaptWithSize(true);
return widget;
};