Jump to content

Can you load image/svg after preload/create functions are called?


Kadith
 Share

Recommended Posts

Hey everyone,

I'm attempting upgrade from Phaser 2.6.2 to Phaser 3.12.0 as I currently need to use SVG's for my project. However I'm having an issue since the way the load manager works seems to have changed.

Previously I could call game.load.image to load an image file from pretty much any function that had access to the game variable, now it seems that this can only be done via the preload and create functions; is there a way to call this outside of those functions?

The reason I need to do this is because the images I am using are dynamically generated from a server which means I don't have them until after the preload and create functions are called.

Thanks,

-Kadith

Link to comment
Share on other sites

Think I've figured out a workaround for my issue for now, seems I can assign this to a variable in the preload function and use that to access the loader afterwards.

Not sure if it's a good idea but seems to work for now!

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...