HCanvas c1, c2, c3; HDrawablePool p1, p2, p3; void setup() { size(640,640); H.init(this).background(#202020); smooth(); c1 = new HCanvas().autoClear(false).fade(15); c2 = new HCanvas().autoClear(false).fade(10); c3 = new HCanvas().autoClear(false).fade(5); H.add(c3); H.add(c2); H.add(c1); p1 = new HDrawablePool(10); p1.autoParent(c1) .add( new HRect(40).rounding(10) ) .onCreate( new HCallback() { public void run(Object obj) { HDrawable d = (HDrawable) obj; d.stroke(#000000,50).fill(#FF3300).anchor(20,-20).loc( (int)random(width), (int)random(height) ); new HRotate(d, 2); } } ) .requestAll() ; p2 = new HDrawablePool(10); p2.autoParent(c2) .add( new HRect(60).rounding(10) ) .onCreate( new HCallback() { public void run(Object obj) { HDrawable d = (HDrawable) obj; d.stroke(#000000,50).fill(#FF6600).anchor(30,-30).loc( (int)random(width), (int)random(height) ); new HRotate(d, 3); } } ) .requestAll() ; p3 = new HDrawablePool(10); p3.autoParent(c3) .add( new HRect(80).rounding(10) ) .onCreate( new HCallback() { public void run(Object obj) { HDrawable d = (HDrawable) obj; d.stroke(#000000,50).fill(#0095a8).anchor(40,-40).loc( (int)random(width), (int)random(height) ); new HRotate(d, 3); } } ) .requestAll() ; } void draw() { H.drawStage(); }