Skip to content

Instantly share code, notes, and snippets.

@pegli
Created January 25, 2013 18:48
Show Gist options
  • Save pegli/4636836 to your computer and use it in GitHub Desktop.
Save pegli/4636836 to your computer and use it in GitHub Desktop.
app.js wrapper for Ejecta sample code
var webgl = require('appersonlabs.webgl');
var win = Ti.UI.createWindow({
backgroundColor:'#ccc'
});
var canvas = webgl.createCanvasView({
height: Ti.Platform.displayCaps.platformHeight,
width: Ti.Platform.displayCaps.platformWidth,
backgroundColor: 'white'
});
win.add(canvas);
win.addEventListener('open', function() {
tabgroup.open();
});
win.open();
var document = {
addEventListener: function(name, handler) {
Ti.API.info("addEventListener("+name+", fn)");
canvas.addEventListener(name, handler);
},
getElementById: function(id) {
return canvas; // hack!
}
};
var window = {
innerWidth: Ti.Platform.displayCaps.platformWidth,
innerHeight: Ti.Platform.displayCaps.platformHeight
};
Ti.include('index.js');
// Image loading changes
/* var img = new Image(); */
var img = Ti.Filesystem.getFile(this.src);
@pegli
Copy link
Author

pegli commented Jan 25, 2013

also commented out tabgroup.open() at the bottom of index.js as it gets called in the window open event listener.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment