rpgtkoolmv / corescript

http://www.rpgmakerweb.com/products/programs/rpg-maker-mv
MIT License
311 stars 75 forks source link

Graphics._setupCssFontLoading Issue when deployed to Android #118

Closed Archeia closed 6 years ago

Archeia commented 7 years ago

If we deploy to Android, the following issue appears:

pixi.js:26471
TypeError: undefined is not a function
at Function.Graphics._setupCssFontLoading (http://localhost:58900/js/rpg_core.js:1777:30)
at Function.Graphics.initialize (http://localhost:58900/js/rpg_core.js:1771:10)
at Function.SceneManager.initGraphics (http://localhost:58900/js/rpg_managers.js:1822:14)
at Function.SceneManager.initialize (http://localhost:58900/js/rpg_managers.js:1811:10)
at Function.SceneManager.run (http://localhost:58900/js/rpg_managers.js:1802:14)
at window.onload (http://localhost:58900/js/main.js:8:18) rpg_managers.js:1949

From our understanding, this is caused by the Graphics.js. We checked the code and could not find what could be causing it. Any thoughts?

Archeia commented 7 years ago

Here's a temporary fix line 1720 of rpg_core.js , add this line: Graphics._cssFontLoading = false

krmbn0576 commented 7 years ago

Thanks, we'll investigate I wrote better temporary fix below 🙂

Graphics._cssFontLoading = document.fonts && document.fonts.ready && typeof document.fonts.ready.then === 'function';
ivanpopelyshev commented 7 years ago

So we have to understand what is "document.fonts.ready" there. In standart its a promise.

krmbn0576 commented 6 years ago

Fixed 😇 PR #131