Jump to content

Phaser Canvas Destroy

Ram M

Recommended Posts

You can remove the entire game and everything in it by calling the `destroy` method on the game instance. If you want to remove the canvas element itself from the DOM, you can get a reference to it with the `canvas` property on the game instance, though I'm not sure if anything will break if you mess with it.

If you haven't stored your game instance in a global variable (which is not the best practice, by the way), you can get it from the `game` on a Scene or its Systems object.

Link to comment
Share on other sites


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...