Hype

github.com / HYPE_Processing
by Joshua Davis and James Cruz
for Processing and ProcessingJS

HYPE_processing, is a collection of classes that performs heavy lifting tasks while using a minimal amount of code writing.
<< back

Your browser does not support the canvas tag.

HDrawablePool / example_003

HYPE, HRect, HDrawablePool, anchor(), extras(HBundle), HIterator

Source code
HDrawablePool pool;

void setup() {
	size(640,640);
	H.init(this).background(#202020);
	smooth();

	pool = new HDrawablePool(100);
	pool.autoAddToStage()
		.add (
			new HRect()
			.rounding(4)
		)

		.onCreate (
			new HCallback() {
				public void run(Object obj) {
					HDrawable d = (HDrawable) obj;
					d
						.fill(#242424)
						.strokeWeight(1)
						.stroke(#999999)
						.loc( (int)random(width), (int)random(height) )
						.anchor( new PVector(5,100) )
						.rotation( (int)random(360) )
						.size(10,50)
					;

					HRotate r = new HRotate();
					r.target(d).speed( random(-2,2) );
				}
			}
		)

		.requestAll()
	;
}

void draw() {
	H.drawStage();
}