I’m using Phaser 3 for a project that needs to run on a low-end device with a small amount of RAM. As such, I need to be very careful with how much memory our game uses at any time. To that end, I would like to remove textures from the Texture Manager when they’re not needed anymore (i.e., when the scene they were loaded for is no longer being rendered).
However, I discovered that I cannot seem to reload the textures when I want to re-enter the scene. I set up my scene to, upon being put to sleep, call TextureManager.remove(key) for each key I used to load textures in the preload function. Later, when I want to re-enter that scene, I call SceneManager.start(sceneKey), and this calls the preload function and the create function, so all seems well and good, but the scene doesn’t render and I get two errors at the console:
Does anyone understand why this is happening? Is there a way to clean out the textures from memory and re-load them in when needed?