JakeCake Posted December 29, 2014 Share Posted December 29, 2014 I am letting users select settings such as antialiasing on / off, canvas / webgl mode, and texture & physics-polygon resolution. To make these kick in, I am saving the desired settings to localStorage (done) and restarting the game via this function.function restartGame() { // Destroy the current game entity game.destroy(); // Boot a new game entity main(); }main() sets up the states again in a new game object and launches boot that launches preload and so on. This all works fine, but for one problem, when I switch from canvas to webgl renderer mode I get some screen artifacts (white quad in the bottom-right) and the screen freezes, no javascript error though. EDIT: The problem doesn't seem to happen when going from canvas -> webgl, but also when going from canvas -> canvas. So it probably has something to do with destroying a game using a canvas renderer. Is there a more built-in way of restarting the game, or is it possible to change renderer & antialiasing on / off without restarting? Link to comment Share on other sites More sharing options...
Mrst2L Posted January 1, 2015 Share Posted January 1, 2015 you can try changing states instead of deleting the entire game object. I don't think phaser was designed to do that. Link to comment Share on other sites More sharing options...
Recommended Posts