How to replace background-image style with loaded textures?


I want to change html body background-image with loaded images.

Any idea how to do this? = `url(${URL})`;
1 Like

How to replace ${URL} to loaded phaser texture/image.

I can get blob url using this.textures.get('bg').getSourceImage().src;

but its not working

In preload():

this.load.on('load', function (file) {
  if (file.key === KEY) { = `url(${file.src})`;

What if not from preload? i mean from a different scene.

i want to get the image from game scene.

I don’t think Phaser saves the load URL, you would have to save it yourself.

Thanks for your help, i will try it.