mirror of
https://github.com/processing/processing4.git
synced 2026-02-03 13:49:18 +01:00
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
// Example 06-01 from "Getting Started with Processing"
|
||||
// by Reas & Fry. O'Reilly / Make 2010
|
||||
|
||||
PImage img;
|
||||
|
||||
void setup() {
|
||||
size(480, 120);
|
||||
img = loadImage("lunar.jpg");
|
||||
}
|
||||
|
||||
void draw() {
|
||||
image(img, 0, 0);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
// Example 06-02 from "Getting Started with Processing"
|
||||
// by Reas & Fry. O'Reilly / Make 2010
|
||||
|
||||
PImage img1;
|
||||
PImage img2;
|
||||
|
||||
void setup() {
|
||||
size(480, 120);
|
||||
img1 = loadImage("lunar.jpg");
|
||||
img2 = loadImage("capsule.jpg");
|
||||
}
|
||||
|
||||
void draw() {
|
||||
image(img1, -120, 0);
|
||||
image(img1, 130, 0, 240, 120);
|
||||
image(img2, 300, 0, 240, 120);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
// Example 06-03 from "Getting Started with Processing"
|
||||
// by Reas & Fry. O'Reilly / Make 2010
|
||||
|
||||
PImage img;
|
||||
|
||||
void setup() {
|
||||
size(480, 120);
|
||||
img = loadImage("lunar.jpg");
|
||||
}
|
||||
|
||||
void draw() {
|
||||
background(0);
|
||||
image(img, 0, 0, mouseX * 2, mouseY * 2);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
// Example 06-04 from "Getting Started with Processing"
|
||||
// by Reas & Fry. O'Reilly / Make 2010
|
||||
|
||||
PImage img;
|
||||
|
||||
void setup() {
|
||||
size(480, 120);
|
||||
img = loadImage("clouds.gif");
|
||||
}
|
||||
|
||||
void draw() {
|
||||
background(255);
|
||||
image(img, 0, 0);
|
||||
image(img, 0, mouseY * -1);
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 136 KiB |
@@ -0,0 +1,16 @@
|
||||
// Example 06-05 from "Getting Started with Processing"
|
||||
// by Reas & Fry. O'Reilly / Make 2010
|
||||
|
||||
PImage img;
|
||||
|
||||
void setup() {
|
||||
size(480, 120);
|
||||
img = loadImage("clouds.png");
|
||||
}
|
||||
|
||||
void draw() {
|
||||
background(204);
|
||||
image(img, 0, 0);
|
||||
image(img, 0, mouseY * -1);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
// Example 06-06 from "Getting Started with Processing"
|
||||
// by Reas & Fry. O'Reilly / Make 2010
|
||||
|
||||
PFont font;
|
||||
|
||||
void setup() {
|
||||
size(480, 120);
|
||||
smooth();
|
||||
font = loadFont("AndaleMono-36.vlw");
|
||||
textFont(font);
|
||||
}
|
||||
|
||||
void draw() {
|
||||
background(102);
|
||||
textSize(36);
|
||||
text("That’s one small step for man...", 25, 60);
|
||||
textSize(18);
|
||||
text("That’s one small step for man...", 27, 90);
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,18 @@
|
||||
// Example 06-07 from "Getting Started with Processing"
|
||||
// by Reas & Fry. O'Reilly / Make 2010
|
||||
|
||||
PFont font;
|
||||
|
||||
void setup() {
|
||||
size(480, 120);
|
||||
font = loadFont("AndaleMono-24.vlw");
|
||||
textFont(font);
|
||||
}
|
||||
|
||||
void draw() {
|
||||
background(102);
|
||||
text("That’s one small step for man...", 26, 30, 240, 100);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,17 @@
|
||||
// Example 06-08 from "Getting Started with Processing"
|
||||
// by Reas & Fry. O'Reilly / Make 2010
|
||||
|
||||
PFont font;
|
||||
String quote = "That’s one small step for man...";
|
||||
|
||||
void setup() {
|
||||
size(480, 120);
|
||||
font = loadFont("AndaleMono-24.vlw");
|
||||
textFont(font);
|
||||
}
|
||||
|
||||
void draw() {
|
||||
background(102);
|
||||
text(quote, 26, 30, 240, 100);
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,17 @@
|
||||
// Example 06-09 from "Getting Started with Processing"
|
||||
// by Reas & Fry. O'Reilly / Make 2010
|
||||
|
||||
PShape network;
|
||||
|
||||
void setup() {
|
||||
size(480, 120);
|
||||
smooth();
|
||||
network = loadShape("network.svg");
|
||||
}
|
||||
|
||||
void draw() {
|
||||
background(0);
|
||||
shape(network, 30, 10);
|
||||
shape(network, 180, 10, 280, 280);
|
||||
}
|
||||
|
||||
4056
java/examples/GettingStartedBook/Chapter06/Ex_06_09/data/network.svg
Normal file
4056
java/examples/GettingStartedBook/Chapter06/Ex_06_09/data/network.svg
Normal file
File diff suppressed because it is too large
Load Diff
|
After Width: | Height: | Size: 322 KiB |
@@ -0,0 +1,18 @@
|
||||
// Example 06-10 from "Getting Started with Processing"
|
||||
// by Reas & Fry. O'Reilly / Make 2010
|
||||
|
||||
PShape network;
|
||||
|
||||
void setup() {
|
||||
size(240, 120);
|
||||
smooth();
|
||||
shapeMode(CENTER);
|
||||
network = loadShape("network.svg");
|
||||
}
|
||||
|
||||
void draw() {
|
||||
background(0);
|
||||
float diameter = map(mouseX, 0, width, 10, 800);
|
||||
shape(network, 120, 60, diameter, diameter);
|
||||
}
|
||||
|
||||
4056
java/examples/GettingStartedBook/Chapter06/Ex_06_10/data/network.svg
Normal file
4056
java/examples/GettingStartedBook/Chapter06/Ex_06_10/data/network.svg
Normal file
File diff suppressed because it is too large
Load Diff
|
After Width: | Height: | Size: 322 KiB |
Reference in New Issue
Block a user