[]微信小游戏IDE加载位图字体,提示错误
错误提示如下:xml.getElementsByTagName is not a function
TypeError: xml.getElementsByTagName is not a function
at BitmapFont.__proto.parseFont (http://127.0.0.1:61385/game/code.js:803:17)
at Loader.__proto.onLoaded (http://127.0.0.1:61385/game/code.js:12700:11)
at HTMLImage.onload (http://127.0.0.1:61385/game/code.js:21213:15)
at Image._source._source.onload (http://127.0.0.1:61385/game/code.js:20175:11)
请问这是什么问题,微信小游戏支持加载位图字体吗?
TypeError: xml.getElementsByTagName is not a function
at BitmapFont.__proto.parseFont (http://127.0.0.1:61385/game/code.js:803:17)
at Loader.__proto.onLoaded (http://127.0.0.1:61385/game/code.js:12700:11)
at HTMLImage.onload (http://127.0.0.1:61385/game/code.js:21213:15)
at Image._source._source.onload (http://127.0.0.1:61385/game/code.js:20175:11)
请问这是什么问题,微信小游戏支持加载位图字体吗?
小游戏是支持位图字体的
你传一个demo我们看看吧
你传一个demo我们看看吧
请问定位到这是什么问题了吗?
我也遇到了这个问题,发现微信小游戏,不支持解析位图字体,ttf文件也不行不支持,现在都不知道怎么搞了
这个问题 解决了吗 我也是加载失败啊
我解决了,在引入js后 window.Parser = require("./js/dom_parser");
在core.js中
/**
*资源加载完成的处理函数。
*@param data 数据。
*/
__proto.onLoaded=function(data){
在
var bFont=new BitmapFont();
bFont.parseFont(this._data,data);之前加入
this._data = Utils.parseXMLFromString(this._data);就ok了
在core.js中
/**
*资源加载完成的处理函数。
*@param data 数据。
*/
__proto.onLoaded=function(data){
在
var bFont=new BitmapFont();
bFont.parseFont(this._data,data);之前加入
this._data = Utils.parseXMLFromString(this._data);就ok了
要回复问题请先登录