Skip to content

Instantly share code, notes, and snippets.

@antonkartashov
Created October 19, 2016 14:35
Show Gist options
  • Save antonkartashov/717217f6edc35e923794c069a5773828 to your computer and use it in GitHub Desktop.
Save antonkartashov/717217f6edc35e923794c069a5773828 to your computer and use it in GitHub Desktop.
buttons = []
layers = []
for i in [0..10]
buttons[i] = new Layer
width: 200, height: 200
backgroundColor: "tomato"
x: Align.right()
opacity: .7
y: i * 205
scale: .5
layers[i] = new Layer
width: Screen.width
y: i * 205
backgroundColor: Utils.randomColor()
image: Utils.randomImage()
layers[i].draggable.enabled = true
layers[i].draggable.vertical = false
layers[i].draggable.constraints =
x: -200
y: 215 * i
width: 750 + 200
height: 200
layers[i].onDragEnd ->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment