Skip to content

Instantly share code, notes, and snippets.

@raheelahmad
Created October 3, 2011 17:35
Show Gist options
  • Save raheelahmad/1259699 to your computer and use it in GitHub Desktop.
Save raheelahmad/1259699 to your computer and use it in GitHub Desktop.
Drawing boxes
class Box {
float x, y, w, h;
void drawItself() {
rect(x, y, w, h);
}
}
Box myBox;
void setup() {
size (500, 500);
myBox = new Box();
myBox.x = 50;
myBox.y = 50;
myBox.w = 50;
myBox.h = 100;
}
void draw() {
myBox.drawItself();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment