1 decade ago by FelipeBudinich
I came across this wrapper for android and iOS, that does the same thing as iOSImpact and appMobi (it calls OpenGl and OpenAl functions instead of <canvas> and <audio>)
http://ludei.com/tech/cocoonjslauncher
I need to run my game on Android (as I don't have the resources to get an Ipad, a Mac, nor the experience to properly build and test on that enviroment), and appMobi is taking too long to release the Android version of DirectCanvas.
In order to use it I need to do the following:
I'm having issues with point 2. How can I tell impact to use that canvas created on runtime?
On system.js I modified the init function like this:
But now I'm getting "Uncaught TypeError: number is not a function" message on my console. Any hints you can provide me with?
http://ludei.com/tech/cocoonjslauncher
I need to run my game on Android (as I don't have the resources to get an Ipad, a Mac, nor the experience to properly build and test on that enviroment), and appMobi is taking too long to release the Android version of DirectCanvas.
In order to use it I need to do the following:
1.- Remove the HTML entry point file.
2.- Create a Canvas object manually from JavaScript. If needed, substitute
document.getElementById
function calls by
document.createElement("canvas");
or
new Canvas();
3.- Put all your JavaScript in one file. Your whole JavaScript code should be in just one .js file.
4.- Create a zip file with your JavaScript file and game assets. The current version of CocoonJS only loads local assets.
I'm having issues with point 2. How can I tell impact to use that canvas created on runtime?
On system.js I modified the init function like this:
this.canvas = document.createElement("canvas"); this.canvas.width= window.innerWidth; this.canvas.height= window.innerHeight; document.body.appendChild( this.canvas ); this.resize( this.canvas.width, this.canvas.height, scale ); this.context = this.canvas.getContext('2d');
But now I'm getting "Uncaught TypeError: number is not a function" message on my console. Any hints you can provide me with?