Created
January 25, 2013 18:48
-
-
Save pegli/4636836 to your computer and use it in GitHub Desktop.
app.js wrapper for Ejecta sample code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Image loading changes | |
/* var img = new Image(); */ | |
var img = Ti.Filesystem.getFile(this.src); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
also commented out tabgroup.open() at the bottom of index.js as it gets called in the window open event listener.