...
<plugins>
...
<plugin>ti.es6</plugin>
...
</plugins>
...
import { Window, Label, View, Animation, _2DMatrix } from './Titanium/UI';
let win = new Window({
title: 'ES6',
layout: 'vertical',
backgroundColor: 'gray'
}),
lbl = new Label({
color: 'white',
font: {
fontSize: '32'
},
text: 'ES6!'
}),
view = new View({
backgroundColor: 'red',
width: 100,
height: 100
}),
matrix = new _2DMatrix({
rotate: 90
}),
animation = new Animation({
transform: matrix,
duration: 3000
});
win.addEventListener('postlayout', async () => {
await view.animate(animation);
view.backgroundColor = 'orange';
alert('DONE ANIMATION!');
});
win.add([lbl, view]);
win.open();
You can also specify sub-modules like so:
import _Titanium from './Titanium';
const { UI } = _Titanium;
const { Window, Label, View, Animation, _2DMatrix } = UI;
Gary Mathews