Shared loader for multiple games

Hi,

Is it possible to preload images for multiple phaser games, something akin to PIXI.Loader?

I have a few games I’ll be loading sequentially onto the same page, and I’d like to preload all their images together before loading each game.

Thank you!
Shmion

Not really. You could use PIXI.Loader or something like it and then add the resources to your games yourself.

Can Phaser load resources from memory, instead of a URL?

Yes, you can add to each game cache or the texture manager.

Thank you @samme. Could you give me some direction on how to do that? Maybe a short snippet? That would be very helpful.

this.textures.addImage('key', image);

See TextureManager methods.

Ah, I see. And I presume ‘image’ is a standard html/javascript image?

Yes.

Thank you!