Skip to content

Instantly share code, notes, and snippets.

@bleikamp
Created September 5, 2014 03:37
Show Gist options
  • Save bleikamp/6457172caa4e5be1a086 to your computer and use it in GitHub Desktop.
Save bleikamp/6457172caa4e5be1a086 to your computer and use it in GitHub Desktop.
boolean export = false;
HDrawablePool pool;
int numframes = 90;
void setup() {
size(500, 500);
H.init(this).background(50);
smooth();
pool = new HDrawablePool(900);
pool.autoAddToStage()
.add(
new HEllipse(), 2
)
.layout(
new HGridLayout()
.startX(10)
.startY(10)
.spacing(20, 20)
.cols(30)
)
.onCreate(
new HCallback() {
public void run(Object obj) {
HDrawable d = (HDrawable) obj;
d
.noStroke()
.fill(#ffffff)
.anchorAt(H.CENTER)
.size(2*noise(0.9))
;
new HOscillator()
.target(d)
.property(H.SIZE)
.range(2*noise(0.1), 20*noise(2))
.speed(1)
.freq(10)
.currentStep(pool.currentIndex()/20);
}
}
).requestAll();
}
void draw() {
H.drawStage();
if(export==true) {
saveFrame("line-######.gif");
if(frameCount == numframes)
exit();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment