Created
July 2, 2014 09:37
-
-
Save Amimul100/710993e15480ced4e56a to your computer and use it in GitHub Desktop.
2DMatrix in Titanium
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
/* | |
Hi, I have tested this issue in Ti SDK 3.3.0.RC. It’s working good. | |
Testing Environment: | |
Titanium SDK: 3.3.0.RC, 3.2.3.GA | |
Titanium CLI: 3.2.3 | |
Android and iOS device | |
Appcelerator Studio, build: 3.3.0.201406271159 | |
Step to Reproduce | |
Create a sample Ti Classic project from AppC Studio | |
Update app.js file with test code | |
Run on Android and iOS device | |
Click the animate button to see 2D animation | |
*/ | |
var win = Ti.UI.createWindow({ | |
backgroundColor: 'white' | |
}); | |
var label = Ti.UI.createLabel({ | |
font:{fontSize:50}, | |
text:'Titanium', | |
textAlign:'center', | |
top: 100 | |
}); | |
win.add(label); | |
var button = Ti.UI.createButton({ | |
title:'Animate', | |
bottom:20, | |
width:200, height:40 | |
}); | |
win.add(button); | |
button.addEventListener('click', function(){ | |
var t1 = Ti.UI.create2DMatrix(); | |
t1 = t1.translate(0, 300); | |
var a1 = Ti.UI.createAnimation(); | |
a1.transform = t1; | |
a1.duration = 800; | |
label.animate(a1); | |
}); | |
win.open(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment