You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Building the demo with no changes to src files causes it to stop working on a mobile device #3
I've cloned the repo and the demo works in the dev tools (Wechat and QQ) and on my mobile device in the app (again, Wechat and QQ).
After running npm install and npm run build the demo continues to with in the dev tools but does not load on my mobile device, with no errors in the console or any feedback.
Perhaps you could remove package-lock.json from .gitignore so I can figure out the exact module versions you used.
After running npm install and npm run build the demo continues to with in the dev tools but does not load on my mobile device, with no errors in the console or any feedback.
This is because pixi.js v5.3.0 has added BitmapFonts and used the XMLDocument, but the wechat environment does not support them, so I have updated @iro/wechat-adapter.
But this evaluates to false, even though the data has been successfully parsed and the next 2 conditions actually evaluate to true: data.getElementsByTagName('page').length && data.getElementsByTagName('info')[0].getAttribute('face') !== null;
If you want to use BitmapFonts in a Wechat or QQ environment, you may need to fully emulate the XMLDocument
implementation, which is a bit too much work.
In @iro/wechat-adapter I just defined XMLDocument so that the program doesn't report errors, use other ways instead of BitmapFonts would be a better choice.
Activity
JetLua commentedon Jul 30, 2020
@bamsarker Fixed. You can try again.
This is because
pixi.js v5.3.0has addedBitmapFontsand used theXMLDocument, but thewechat environmentdoes not support them, so I have updated @iro/wechat-adapter.bamsarker commentedon Jul 30, 2020
Thanks @JetLua this was very helpful.
Now I've got an issue which is not in your original fish repo, but is regarding loading
BitmapFontsand theXMLDocumentclass.PIXI is checking that the response data of a
.fntfile is an instance ofXMLDocumenthere: https://github.com/pixijs/pixi.js/blob/dev/packages/text-bitmap/src/formats/XMLFormat.ts#L21But this evaluates to
false, even though the data has been successfully parsed and the next 2 conditions actually evaluate totrue:data.getElementsByTagName('page').length && data.getElementsByTagName('info')[0].getAttribute('face') !== null;I've created a fork of
fishwith a BitmapFont added, see the relevant log here: https://github.com/bamsarker/fish/blob/master/src/scenes/prepare.jsJetLua commentedon Jul 30, 2020
If you want to use
BitmapFontsin aWechatorQQenvironment, you may need to fully emulate theXMLDocumentimplementation, which is a bit too much work.
In
@iro/wechat-adapterI just definedXMLDocumentso that the program doesn't report errors, use other ways instead ofBitmapFontswould be a better choice.JetLua commentedon Dec 4, 2020
Oh, not exactly. You can use FNT instead of XML.