Created
October 3, 2011 17:35
-
-
Save raheelahmad/1259699 to your computer and use it in GitHub Desktop.
Drawing boxes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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