cocostudio在JS中的使用
申明:cocos2d-js只能加载导出的json文件,不能加载csb文件。
首先,我们来看看在JS-Test中的代码
JS-test中的代码:
_parseUIFile: function(file){
if(cocoStudioOldApiFlag == 0){
//如果是老版本
cc.log("ccs.load : %s", file);
var json = ccs.load(file);
return json.node;
}else{
//如果是新版本
cc.log("ccs.uiReader.widgetFromJsonFile : %s", file);
return ccs.uiReader.widgetFromJsonFile(file)
}
},