Skip to content

Instantly share code, notes, and snippets.

@bleikamp
Last active September 15, 2016 08:12
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bleikamp/508b5ad516d5869d7491 to your computer and use it in GitHub Desktop.
Save bleikamp/508b5ad516d5869d7491 to your computer and use it in GitHub Desktop.
boolean export = true;
int numframes = 90;
HDrawablePool pool;
void setup() {
size(800, 600);
H.init(this).background(50);
smooth();
pool = new HDrawablePool(2000);
pool.autoAddToStage()
.add(
new HEllipse(), 0
)
.layout(
new HGridLayout()
.startX(10)
.startY(10)
.spacing(20, 20)
.cols(40)
)
.onCreate(
new HCallback() {
public void run(Object obj) {
HDrawable d = (HDrawable) obj;
d
.noStroke()
.fill(#ffffff)
.anchorAt(H.CENTER)
.size(10*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()/100);
}
}
).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