kishan Posted April 19, 2019 Share Posted April 19, 2019 Hi All, I am new to phaser and going through it and i came across state in phaser. I need to know if i can maintain my pervious state active in the background so that i can be able to handle assets loading in the active without getting caught in the Phaser.cache.getImage error. Thanks in advance, Link to comment Share on other sites More sharing options...
fruitiongames Posted April 25, 2019 Share Posted April 25, 2019 Hello! I may misunderstand what you're asking but in my game I switch between states via code like this. this.game.state.start('MainMenu', true, false); That third parameter that's passed as false indicates whether the game cache should be cleared. Here's the exact phrasing: @param clearCache — Clear the Game.Cache? This purges out all loaded assets. The default is false and you must have clearWorld=true if you want to clearCache as well. As long as you're passing it as false (or not passing it at all as the default value is false) you should not have trouble loading assets just because you switched state. Let us know if that helps! Thanks Link to comment Share on other sites More sharing options...
Recommended Posts