Created
October 30, 2011 13:27
-
-
Save Seasons7/1325896 to your computer and use it in GitHub Desktop.
Titanium Growl Animation
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
Titanium.UI.setBackgroundColor('#000'); | |
var window = Ti.UI.createWindow({ | |
title:'テスト', | |
backgroundColor:'#FFF' | |
}); | |
var label = Ti.UI.createLabel({ | |
bottom:0, | |
color:'#FFF', | |
opacity:0.8, | |
font:{fontWeight:'bold'}, | |
backgroundColor:'#000', | |
text:'下からにゅるっとアニメーション\nマルチライン対応', | |
textAlign:'center', | |
width:320, | |
height:'auto', | |
}); | |
label.bottom = -label.height; | |
var mtx = Ti.UI.create2DMatrix().translate(0,-label.height); | |
var animation = Ti.UI.createAnimation({ | |
duration:1000, | |
transform:mtx | |
}); | |
animation.addEventListener('complete',function(){ | |
setTimeout( function(){ | |
mtx = Ti.UI.create2DMatrix(); | |
label.animate( {transform:mtx,duration:1000} ); | |
},500 ); | |
}); | |
label.animate( animation ); | |
window.add( label ); | |
window.open(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment