Closed shenxiyou closed 5 years ago
直接给到代码你: ` UIPackage.prototype.loadFont = function (item) { var font = new cc.LabelAtlas(); item.asset = font; font._fntConfig = { atlasName: item.name, //change by MixMarvel commonHeight: 0, fontSize: 0, kerningDict: {}, fontDefDictionary: {} };
`
这是加了一行 atlasName: item.name 吗? 似乎并没有用, 请教一下该怎么改?
对的,可以调试其源码,应该会发现,新版本引擎以atlasName为Key去找bmfont字体,FGUI里面没有声明该属性,默认Key会变成undefined,后面的bmfont因为Key也是undefined,所以会出现只会默认使用第一个的情况。我这边如上改动是修复了该现象。
我测试了2.1.3,2.2.0,没发现需要加这句话。你再用最新代码试试。
cose
直接给到代码你: ` UIPackage.prototype.loadFont = function (item) { var font = new cc.LabelAtlas(); item.asset = font; font._fntConfig = { atlasName: item.name, //change by MixMarvel commonHeight: 0, fontSize: 0, kerningDict: {}, fontDefDictionary: {} };
`