Created
January 3, 2013 16:54
-
-
Save phawk/4444844 to your computer and use it in GitHub Desktop.
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
var rect1 = new Rect(); | |
rect1.color('blue'); // any CSS colour value | |
rect1.position(100, 200); // x, y | |
rect1.size(300, 150); // width, height | |
rect1.show(); // Shows the rectangle on screen (appends it to body) | |
rect1.hide(); // Detatches the rectabgle from the DOM | |
// I would also love a shorthand way of specifying the arguments in the | |
// constructor, at least the width, height and colour. | |
var rect2 = new Rect(200, 100, 'red'); // width, height, colour - All optional | |
rect2.position(300, 100); | |
rect2.show(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment