Jump to content

How to use Phaser with Angular.js


js4fun
 Share

Recommended Posts

Hi all,

 

  I am using Phaser to develop a game in a site which power by angularJS.

 

  Now I have two pages, home page and the Phaser game page.

 

  When I link to the game page from home page, then link back to home page, and then link to game page again, I get errors below:

    WebGL: INVALID_OPERATION: uniform2f: location not for current program
    WebGL: INVALID_OPERATION: bindTexture: object not from this context 
 
  As is known to all, angularJS site is Single Page Application, which means that there is only one web page, and when I link to the game page then link to other page, the Phaser instance may not be destoryed.
 
  For example, when I use CKEditor in angularJS, I always use code below to avoid this issue:
     var editor = CKEDITOR.instances[name];
   if (editor) {
     editor.destroy(true)
  }
 //create a new instance...
 
Is there method(s) like destroy() or kill() in Phaser to terminal a instance?
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.

Guest
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.

Loading...
 Share

  • Recently Browsing   0 members

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