Skip to content

Instantly share code, notes, and snippets.

@macklinu
Created October 30, 2013 04:50
Show Gist options
  • Select an option

  • Save macklinu/7227370 to your computer and use it in GitHub Desktop.

Select an option

Save macklinu/7227370 to your computer and use it in GitHub Desktop.
mouseWheel() fun
float total = 0;
void setup() {
size(400, 400);
}
void draw() {
background(50);
fill(total > 0 ? color(0, 255, 0) : color(255, 0, 0));
ellipse(width/2, height/2, total, total);
}
void mouseWheel(MouseEvent event) {
float e = event.getAmount();
total += e;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment