Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building the demo with no changes to src files causes it to stop working on a mobile device #3

Open
bamsarker opened this issue Jul 29, 2020 · 4 comments
Labels
good first issue Good for newcomers

Comments

@bamsarker
Copy link

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.

Thanks!

@JetLua JetLua added the good first issue Good for newcomers label Jul 30, 2020
@JetLua
Copy link
Owner

JetLua commented Jul 30, 2020

@bamsarker Fixed. You can try again.

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.

@bamsarker
Copy link
Author

Thanks @JetLua this was very helpful.

Now I've got an issue which is not in your original fish repo, but is regarding loading BitmapFonts and the XMLDocument class.

PIXI is checking that the response data of a .fnt file is an instance of XMLDocument here: https://github.com/pixijs/pixi.js/blob/dev/packages/text-bitmap/src/formats/XMLFormat.ts#L21

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;

I've created a fork of fish with a BitmapFont added, see the relevant log here: https://github.com/bamsarker/fish/blob/master/src/scenes/prepare.js

@JetLua
Copy link
Owner

JetLua commented Jul 30, 2020

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.

@JetLua
Copy link
Owner

JetLua commented Dec 4, 2020

Oh, not exactly. You can use FNT instead of XML.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants