Created
August 25, 2017 11:06
-
-
Save RayPS/bfdfc3cb48f7974ac2c9cdb92ec53476 to your computer and use it in GitHub Desktop.
Framer-Layer-Stack
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
Array::stack = (spacing = 0) -> | |
for layer, index in this | |
layer.y = this[index-1]?.maxY | |
layer.y += spacing | |
# Example: | |
bg = new BackgroundLayer | |
for i in [0...10] | |
new Layer | |
parent: bg | |
width: Utils.randomNumber(50, 200) | |
height: Utils.randomNumber(10, 100) | |
backgroundColor: Utils.randomColor() | |
bg.onTap -> | |
this.children.stack() |
Author
RayPS
commented
Aug 25, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment