Created
June 16, 2013 20:37
-
-
Save yoshuawuyts/5793336 to your computer and use it in GitHub Desktop.
Triangle website as seen on http://www.reddit.com/r/web_design/comments/1gficp/a_simple_website_i_made_using_processingjs_for/
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
/start code | |
int mX, mY; //global variable initialization | |
void setup() { //note sure about making the screen scalable, but if you can | |
size(640, 480); //the code for drawing the triangles is parametric, so it would work | |
background(200); | |
noStroke(); //outlines are bad | |
} | |
void draw() { | |
mX = mouseX; //sets mX to cursor's X position | |
mY = mouseY; //sets mY to cursor's Y position | |
fill(155, 111, 111, 111); | |
triangle(0, height, mouseX, mouseY, width/2, height); //draws red triangle | |
fill(105, 185, 185, 111); | |
triangle(width/2, height, mouseX, mouseY, width, height); //draws blue triangle | |
} | |
//endcode |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment