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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

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