I'm trying to figure out how to load fonts in to a phaser scene from local assets or google fonts.
In my game, I load all the assets in the first scene(Preload scene) and I don't want to load anything in my other scene's preload
function.
The problem is I have multiple scenes in my game and fonts that are loaded in the first scene but not available in the other scenes.
I tried the webfontloader
plugin and also the below example in phaser labs.
- https://rexrainbow.github.io/phaser3-rex-notes/docs/site/webfontloader/
- http://labs.phaser.io/edit.html?src=src/game%20objects/text/static/custom%20webfont.js
How can I load fonts in my Preload Scene and use them in all the other scenes?
Thanks.
If you want pass the value from preload scene to other scene.
I recommend using object to save it.
This is how I pass the value to next scene.