Skip to content

Instantly share code, notes, and snippets.

@Seasons7
Created October 30, 2011 13:27
Show Gist options
  • Save Seasons7/1325896 to your computer and use it in GitHub Desktop.
Save Seasons7/1325896 to your computer and use it in GitHub Desktop.
Titanium Growl Animation
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