Danisimo Posted July 14, 2020 Share Posted July 14, 2020 Hello everyone, I'm trying to handle a very specific case. I have custom loader logic which handles the loss of internet connection and retries the loading of game resources a few times before giving up. This works great for most types of assets except BitMapFonts. The .fnt files that are used to load in the fonts reference the corresponding font .png files. The problem is if your connection drops while the font .png files are loading, the BitMapFont loader will still try to create a font with the unloaded texture and start throwing errors. I thought I might be able to handle this by loading the images separately from the fnt files and just providing a loaded texture to the BitMapFont loader, when the fnt file loads. Could I get some advice on how to best approach this? Has anyone dealt with a similar issue? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted July 15, 2020 Share Posted July 15, 2020 Yes, its possible. You just have to specify name accordingly, because bitmapText loader has this part: https://github.com/pixijs/pixi.js/blob/dev/packages/text-bitmap/src/BitmapFontLoader.ts#L70 . So, if a resource with appropriate name exists (debug, which one!) its taken. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.