Last active
May 8, 2018 19:33
-
-
Save steveruizok/86ea8c05e152af5abac6974cb61ad47e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
specialButton = undefined | |
handleTap = (event, layer) -> | |
if specialButton is @ | |
@backgroundColor = "grey" | |
specialButton = undefined | |
return | |
specialButton = @ | |
@backgroundColor = "orange" | |
for sib in @siblings | |
sib.backgroundColor = "grey" | |
buttons = _.range(6).map (i) => | |
btn = new Layer | |
size: 80 | |
y: Align.center() | |
x: 128 | |
backgroundColor: "grey" | |
btn.onTap handleTap | |
return btn | |
for button, i in buttons | |
continue if i is 0 | |
button.x = buttons[i-1].maxX + 16 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment