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

 Share

  • Recently Browsing   0 members

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