Created
March 7, 2016 01:48
-
-
Save echophon/21a2daddf462e4074eb4 to your computer and use it in GitHub Desktop.
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
import hype.*; | |
import hype.extended.layout.*; | |
HDrawablePool pool; | |
void setup() { | |
size(800,800); | |
H.init(this).background(#000000); | |
pool = new HDrawablePool(1024); | |
pool.autoAddToStage() | |
.add (new HShape("tess37.svg").strokeJoin(ROUND).strokeCap(ROUND).anchorAt(H.CENTER)) | |
.add (new HShape("tess38.svg").strokeJoin(ROUND).strokeCap(ROUND).anchorAt(H.CENTER)) | |
.add (new HShape("tess39.svg").strokeJoin(ROUND).strokeCap(ROUND).anchorAt(H.CENTER)) | |
.add (new HShape("tess41.svg").strokeJoin(ROUND).strokeCap(ROUND).anchorAt(H.CENTER)) | |
.add (new HShape("tess42.svg").strokeJoin(ROUND).strokeCap(ROUND).anchorAt(H.CENTER)) | |
.add (new HShape("tess43.svg").strokeJoin(ROUND).strokeCap(ROUND).anchorAt(H.CENTER)) | |
.layout ( | |
new HGridLayout() | |
.startX(height/64) | |
.startY(width/64) | |
.spacing(height/32,width/32) | |
.cols(32) | |
) | |
.onCreate ( | |
new HCallback() { | |
public void run(Object obj) { | |
HShape d = (HShape) obj; | |
d | |
.enableStyle(false) | |
.rotation( ((int)random(4)) * 90 ) | |
.size(height/32,width/32) | |
.fill(#FFFFFF) | |
.stroke(#FFFFFF) | |
.strokeWeight(2) | |
; | |
} | |
} | |
) | |
.requestAll() | |
; | |
} | |
void draw() { | |
H.drawStage(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment