mustardseed Posted November 4, 2015 Share Posted November 4, 2015 I spent all last night looking for examples of how to use Phaser in Ejecta. I kept seeing people say they had success, but no code examples. I kept getting an error saying "Could not create Canvas or WebGL context".Now that Ejecta supports AppleTV, I'd love to port some of my Phaser games. Does anyone have a better example of how to get Phaser working in Ejecta? Thanks! Link to comment Share on other sites More sharing options...
rich Posted November 4, 2015 Share Posted November 4, 2015 Has Phaser ever worked with Ejecta?! I didn't think it did. Link to comment Share on other sites More sharing options...
mustardseed Posted November 4, 2015 Author Share Posted November 4, 2015 There's references to Ejecta inside Phaser, so I took it to mean it did at some point. Pixi and Three.js work well with it, but the hangup I had with Phaser seems to be with forcing it to use an existing canvas element instead of creating its own. Link to comment Share on other sites More sharing options...
mustardseed Posted November 4, 2015 Author Share Posted November 4, 2015 I got it working! I had to make a few changes within Phaser. There's probably a better way, but changing these 3 lines helped it start working: 34463 - Change this line to grab the Ejecta created canvas: this.canvas = document.getElementById('canvas'); 34478 - Change this.device.canvas to this.device.ejecta 74915 - Removing the scrollTo function chongdashu 1 Link to comment Share on other sites More sharing options...
patrickfabrizius Posted December 30, 2015 Share Posted December 30, 2015 Pixi and Three.js work well with it, but the hangup I had with Phaser seems to be with forcing it to use an existing canvas element instead of creating its own. Which version of PIXI & Ejecta was that?It doesn't work for me with Ejecta 2.0 and PIXI 3.0.2. (For CanvasRenderer it breaks with TypeError: this.interactionDOMElement.addEventListener is not a function and for GLRenderer I get TypeError: this.view.addEventListener is not a function.) Link to comment Share on other sites More sharing options...
Recommended Posts