Jump to content

newbie - problems with Ejecta


Rui Abrantes
 Share

Recommended Posts

Hello everyone,
 
I'm newbie with Phaser and I am trying to run it with Ejecta, but it fails on the iPhone:
Error: Phaser.Game - cannot create Canvas or WebGL context, aborting. at line 13428 in phaser.js
 
This is the basic code:
 

ejecta.include('phaser.js');
 
var w = window.innerWidth;
var h = window.innerHeight;
 
var game = new Phaser.Game(w, h, Phaser.AUTO, 'canvas', { preload: preload, create: create, update: update });
 
 
function preload() {
    game.load.image('box', 'assets/box.png');
}
 
function create() {
    game.add.sprite(200, 200, 'box');
}
 
function update() {
 

 
I'm much appreciated if someone show me a simple demo.
Sorry for my english.
 
Thank you :)

Link to comment
Share on other sites

  • 2 months later...

I'm also looking for some information on this.  Phaser uses PIXI, so to remove some distraction, I tested just PIXI.

 

To use PIXI, I had to comment out several of it's DOM method calls, which aren't supported by Ejecta.  After commenting those out, I finally cleared up all the errors in Xcode console, which were coming from Ejecta.  The last log I now get is:

2014-05-08 00:07:33.147 Ejecta[1867:60b] Creating Offscreen Canvas (2D): size: 768x1024, retina: yes = 1536x2048, msaa: no

2014-05-08 00:07:33.150 Ejecta[1867:60b] JS: Phaser v2.0.4 - Renderer: WebGL - Audio: HTML Audio - http://phaser.io

 

So, I think I got close, but stopped.  I don't think PIXI and therefore Phaser will work within Ejecta.  I'd love to be corrected (or see some support for it.)

 

The reason I started looking at Ejecta is because I wanted to compare performance to CocoonJS.   With CocoonJS, it was very easy to get my app running on iOS; however, I was disappointed with performance and hoping Ejecta might do a little better.

Link to comment
Share on other sites

  • 5 months later...

Has anyone gotten Phaser to work in Ejecta yet?  I get this when I start a relatively simple Phaser app (just shows an image).

 

2014-10-25 18:02:09.194 Ejecta[20105:1075530] Creating Offscreen Canvas (2D): size: 320x568, retina: yes = 640x1136, msaa: no

2014-10-25 18:02:09.199 Ejecta[20105:1075530] Creating Offscreen Canvas (2D): size: 1x1, retina: yes = 2x2, msaa: no

2014-10-25 18:02:09.260 Ejecta[20105:1075530] Error: Can't Find Module ../../../../Downloads/phaser-master 2/package.json

2014-10-25 18:02:09.354 Ejecta[20105:1075530] Creating Offscreen Canvas (2D): size: 320x568, retina: yes = 640x1136, msaa: no

2014-10-25 18:02:09.360 Ejecta[20105:1075530] Error: Phaser.Game - cannot create Canvas or WebGL context, aborting. at line 24470 in lib/phaser/phaser.js

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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