Initial Commit
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
/**
|
||||
* Loading URLs.
|
||||
*
|
||||
* Click on the button to open a URL in a browser
|
||||
*/
|
||||
|
||||
boolean overButton = false;
|
||||
|
||||
void setup() {
|
||||
size(640, 360);
|
||||
}
|
||||
|
||||
void draw() {
|
||||
background(204);
|
||||
|
||||
if (overButton == true) {
|
||||
fill(255);
|
||||
} else {
|
||||
noFill();
|
||||
}
|
||||
rect(105, 60, 75, 75);
|
||||
line(135, 105, 155, 85);
|
||||
line(140, 85, 155, 85);
|
||||
line(155, 85, 155, 100);
|
||||
}
|
||||
|
||||
void mousePressed() {
|
||||
if (overButton) {
|
||||
link("http://www.processing.org");
|
||||
}
|
||||
}
|
||||
|
||||
void mouseMoved() {
|
||||
checkButtons();
|
||||
}
|
||||
|
||||
void mouseDragged() {
|
||||
checkButtons();
|
||||
}
|
||||
|
||||
void checkButtons() {
|
||||
if (mouseX > 105 && mouseX < 180 && mouseY > 60 && mouseY <135) {
|
||||
overButton = true;
|
||||
} else {
|
||||
overButton = false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
* Loading Images.
|
||||
*
|
||||
* Processing applications can load images from the network.
|
||||
*
|
||||
*/
|
||||
|
||||
PImage img;
|
||||
|
||||
void setup() {
|
||||
size(640, 360);
|
||||
img = loadImage("http://processing.org/img/processing-web.png");
|
||||
noLoop();
|
||||
}
|
||||
|
||||
void draw() {
|
||||
background(0);
|
||||
if (img != null) {
|
||||
for (int i = 0; i < 5; i++) {
|
||||
image(img, 0, img.height * i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user