Created
November 29, 2011 18:21
-
-
Save alanleard/1405820 to your computer and use it in GitHub Desktop.
Drag & Drop Blocks
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
var win = Titanium.UI.createWindow(); | |
var item1 = Ti.UI.createView({ | |
top:166, | |
left:180, | |
height:87, | |
width:60, | |
backgroundColor:'blue' | |
}); | |
win.add(item1); | |
var item2 = Ti.UI.createImageView({ | |
top:166, | |
left:80, | |
height:87, | |
width:100, | |
backgroundColor:'red' | |
}); | |
win.add(item2); | |
var item3 = Ti.UI.createImageView({ | |
top:100, | |
height:66, | |
width:160, | |
backgroundColor:'green' | |
}); | |
win.add(item3); | |
item1.addEventListener('touchmove', function(e){ | |
item1.center=e.globalPoint; | |
}); | |
item2.addEventListener('touchmove', function(e){ | |
item2.center=e.globalPoint; | |
}); | |
item3.addEventListener('touchmove', function(e){ | |
item3.center=e.globalPoint; | |
}); | |
win.open(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment