Permalink
Browse files

Merge pull request #34 from amadeus/master

Making it easier to use Ejecta in development
  • Loading branch information...
2 parents 07aa553 + 7a7a949 commit e2bdc48375cda2c93ffdb0c9c745fedecb96621b @phoboslab committed Oct 18, 2012
Showing with 26 additions and 7 deletions.
  1. +5 −1 .gitignore
  2. +12 −3 README.md
  3. +9 −3 {App → }/index.js
View
@@ -15,4 +15,8 @@ xcuserdata
profile
*.moved-aside
DerivedData
-.idea/
+.idea/
+
+# Ignoring App folder for
+# ease of implementation
+App
View
@@ -1,8 +1,17 @@
-Ejecta
-==========
+# Ejecta
Ejecta is a fast, open source JavaScript, Canvas & Audio implementation for iOS. Think of it as a Browser that can only display a Canvas element.
More info & Documentation: http://impactjs.com/ejecta
-Ejecta is published under the [MIT Open Source License](http://opensource.org/licenses/mit-license.php).
+Ejecta is published under the [MIT Open Source License](http://opensource.org/licenses/mit-license.php).
+
+
+## How to use
+
+1. Create a folder call `App` within this XCode project
+2. Copy your canvas application into the `App` folder
+3. Ensure you have at least 1 file named `index.js`
+4. Build the XCode project
+
+For an example implementation, copy `./index.js` into the `App` folder
View
@@ -1,10 +1,16 @@
+/*
+
+ INSTRUCTIONS:
+ This file must be copied into ./App in order to work
+
+*/
var w = window.innerWidth;
var h = window.innerHeight;
var w2 = w/2;
var h2 = h/2;
var canvas = document.getElementById('canvas');
-canvas.width = w
+canvas.width = w;
canvas.height = h;
var ctx = canvas.getContext('2d');
@@ -28,7 +34,7 @@ var animate = function() {
// Use the additive blend mode to draw the bezier curves
ctx.globalCompositeOperation = 'lighter';
-
+
// Calculate curve positions and draw
for( var i = 0; i < maxCurves; i++ ) {
var curve = curves[i];
@@ -65,4 +71,4 @@ ctx.fillRect( 0, 0, w, h );
ctx.globalAlpha = 0.05;
ctx.lineWidth = 2;
-setInterval( animate, 16 );
+setInterval( animate, 16 );

0 comments on commit e2bdc48

Please sign in to comment.