Advertisement
JoshuaDavis

HGroup + nesting + HOscillator

Jan 31st, 2014
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.56 KB | None | 0 0
  1. HGroup rects;
  2. HRect r1, r2;
  3.  
  4. void setup(){
  5.     size(640,640);
  6.     H.init(this).background(#202020);
  7.     smooth();
  8.  
  9.     rects = H.add(new HGroup());
  10.     rects.anchorAt(H.CENTER).loc(width/2,height/2);
  11.  
  12.     r1 = new HRect(100).rounding(10);
  13.     rects.add(r1)
  14.         .anchorAt(H.CENTER)
  15.         .noStroke()
  16.         .fill(#FF3300)
  17.     ;
  18.  
  19.     r2 = new HRect(50).rounding(5);
  20.     rects.add(r2)
  21.         .anchorAt(H.CENTER)
  22.         .noStroke()
  23.         .fill(#0095a8)
  24.     ;
  25.  
  26.     new HOscillator()
  27.         .target(rects)
  28.         .property(H.SCALE)
  29.         .range(0.25, 2)
  30.         .speed(0.5)
  31.         .freq(5)
  32.     ;
  33. }
  34.  
  35. void draw(){
  36.     H.drawStage();
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement