Skip to content

Instantly share code, notes, and snippets.

@echophon
Created March 7, 2016 01:48
Show Gist options
  • Save echophon/21a2daddf462e4074eb4 to your computer and use it in GitHub Desktop.
Save echophon/21a2daddf462e4074eb4 to your computer and use it in GitHub Desktop.
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