Skip to content

Commit

Permalink
test wit hbars and animator
Browse files Browse the repository at this point in the history
  • Loading branch information
camillol committed Oct 14, 2011
1 parent c3a562e commit 59ed714
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions cs424p3.pde
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
View rootView;

HBar hbar;
HBar hbar2;
Animator anim;

void setup()
{
size(1024, 768);
Expand All @@ -10,18 +14,23 @@ void setup()

rootView = new View(0, 0, width, height);

View hbar = new HBar(100,100,200,20);
hbar = new HBar(100,100,200,20);
rootView.subviews.add(hbar);

View hbar2 = new HBar(100,200,200,20);
hbar2 = new HBar(100,200,200,20);
rootView.subviews.add(hbar2);

anim = new Animator(0);
}

void draw()
{
background(50); /* seems to be needed to actually clear the frame */
Animator.updateAll();

anim.target(hbar.level);
hbar2.level = anim.value;

rootView.draw();
}

Expand Down

0 comments on commit 59ed714

Please sign in to comment.