VincentB Posted March 11, 2018 Share Posted March 11, 2018 Hi guys, How can I get my image loaded from the cache ? It seems it was possible in Phaser2 but I'm not sure in Phaser3. I looked at https://phaser.io/phaser3/api/cache and it seems there is currently no support for that, can you confirm ? edit: I'm loading the image normally with this.load.image('top-sky-background', 'assets/background/sky_sd.png'); Link to comment Share on other sites More sharing options...
samme Posted March 11, 2018 Share Posted March 11, 2018 What exactly are you trying to do? If you've assigned an image asset to a game object, you can find it in obj.texture.source[0].image. Link to comment Share on other sites More sharing options...
PixelPicoSean Posted March 12, 2018 Share Posted March 12, 2018 Images are stored in the TextureManager, which can be access from game.textures but as Texture instances. Link to comment Share on other sites More sharing options...
rich Posted March 12, 2018 Share Posted March 12, 2018 As has been mentioned, all images are stored in the Texture Manager. You can get the raw image data like this: var tex = this.textures.get('key'); tex.getSourceImage(); You can pass getSourceImage a frame key, should the texture span multiple image files (like in a multi-texture set-up) Sergey Gornostaev and Pavel Mishin 2 Link to comment Share on other sites More sharing options...
VincentB Posted March 18, 2018 Author Share Posted March 18, 2018 Thanks all, I'll try all this. Sorry I was away 1 week, couldn't reply before. Link to comment Share on other sites More sharing options...
Recommended Posts