HGroup + nesting + HOscillator
HGroup rects;
HRect r1, r2;
void setup(){
size(640,640);
H.init(this).background(#202020);
smooth();
rects = H.add(new HGroup());
rects.anchorAt(H.CENTER).loc(width/2,height/2);
r1 = new HRect(100).rounding(10);
rects.add(r1)
.anchorAt(H.CENTER)
.noStroke()
.fill(#FF3300)
;
r2 = new HRect(50).rounding(5);
rects.add(r2)
.anchorAt(H.CENTER)
.noStroke()
.fill(#0095a8)
;
new HOscillator()
.target(rects)
.property(H.SCALE)
.range(0.25, 2)
.speed(0.5)
.freq(5)
;
}
void draw(){
H.drawStage();
}
Comments