Jump to content

Ejecta supports AppleTV. How can I get Phaser working with Ejecta?


Recommended Posts

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

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
Link to comment
Share on other sites

  • 1 month later...

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

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