[]微信小游戏加载 BitmapFont 问题

IDE 版本:1.7.19.1beta
LayaAir 版本:1.7.19.1beta
------------------------
发布成微信小游戏之后,解析 BitmapFont 出错

9821E189-5112-4A12-801D-655D71BE8CB7.png

------------------------
game.js 里面有添加这些
require("weapp-adapter.js");
window.Parser = require("./js/dom_parser");
require("code.js");
在加载这个文件的时候
Laya.loader.load([{ url: "button_font.fnt" }], Handler.create(null, onLoaded));
DFC0B431-48E4-41BA-A210-80E426E0813A.png

图片里的 type="font",最终执行的 tempData=data.data; tempData 直接就是button_font.fnt里面内容的字符串类型
MiniLoader.onReadNativeCallBack=function(encoding,url,type,cache,group,ignoreCache,thisLoader,errorCode,data){
(cache===void 0)&& (cache=true);
(ignoreCache===void 0)&& (ignoreCache=false);
(errorCode===void 0)&& (errorCode=0);
if (!errorCode){
var tempData;
if (type==/*laya.net.Loader.JSON*/"json" || type==/*laya.net.Loader.ATLAS*/"atlas"){
tempData=MiniAdpter.getJson(data.data);
}else if (type==/*laya.net.Loader.XML*/"xml"){
tempData=Utils.parseXMLFromString(data.data);
}
// else if (type==/*laya.net.Loader.XML*/"font"){
// tempData=Utils.parseXMLFromString(data.data);
// }
else {
tempData=data.data;
}
if(!MiniAdpter.isZiYu &&MiniAdpter.isPosMsgYu && type !=/*laya.net.Loader.BUFFER*/"arraybuffer"){
/*__JS__ */wx.postMessage({url:url,data:tempData,isLoad:"filedata"});
}
thisLoader.onLoaded(tempData);
}else if (errorCode==1){
MiniAdpter.EnvConfig.load.call(thisLoader,url,type,cache,group,ignoreCache);
}
}
最终导致下图这个错误

9821E189-5112-4A12-801D-655D71BE8CB7.png

-----------------------
这里是否需要添加这个判断?类型是 "font" 的时候也按 "xml" 类型解析?

0591544EA7D195D5E92E4BFAE1824086.jpg

-----------------------
上传的 demo 里面只加载里 button_font.fnt
已邀请:

Aar0n

赞同来自:

可以自己先把那个判断加上。。。稍后我们研究一下引擎的判断。

JasonLu

赞同来自:

111.png

是有这个问题,我就是这么改的

David Chen

赞同来自:

我也遇到这个问题,怎么解决呀。我不懂这些的。

要回复问题请先

商务合作
商务合作