Is there a timeframe for when we can develop modules for Mobileweb?
I'm particularly interested in being able to wrap a <canvas> element to use for drawing. I've checked the nightly builds and it appears there is something there, but I'm wondering when this ability will be generally available?
Thanks!
2 Answers
Accepted Answer
It's working now in the nightly CI builds! :)
However, the nightly builds are not considered "stable". You will need to use the titanium.py Python command line scripts from the Titanium mobilesdk folder to create the module. After writing your module, you can run the build.py to compile the module.
The compiled module is zipped up. You can unzip this file and manually install the module into your Titanium mobilesdk path or in your specific app's module directory (not created by default, sibling to Resources).
Your module code will need to look like this:
define(["Ti/_/declare", "Ti/UI/View"], function(declare, View) { return declare("MyCanvasView", View, { domType: "canvas", constructor: function(params) { // init } }); });Then in your app.js, just:
var myCanvasView = require("name of your module"); var win = Ti.UI.createWindow(); win.add(new myCanvasView({ /* params go here */ })); win.open();There are no docs on how to do all this. :(
Magnificent! This is a spectacular start!
Thanks for the help Chris! (Bear Hugs Chris)
Your Answer
Think you can help? Login to answer this question!