//(Color-Me) ABCDE's
//Type A-E to turn each page
//press & move the mouse to color it
PFont font;
PFont small;
PFont smaller;
PFont helv;
PImage image_a;
PImage image_b;
PImage image_c;
PImage image_d;
PImage image_e;
PGraphics pg;
int mode = 0;
void setup () {
size(400, 400);
smooth();
background (0);
font = loadFont("DIN-Medium-36.vlw");
small = loadFont("DIN-Medium-24.vlw");
smaller = loadFont("DIN-Medium-18.vlw");
helv = loadFont("Helvetica-48.vlw");
textFont(font);
pg = createGraphics(width, height, JAVA2D);
image_a = loadImage("a.png");
image_b = loadImage("b.png");
image_c = loadImage("c.png");
image_d = loadImage("d.png");
image_e = loadImage("e.png");
}
void draw() {
float x = mouseX;
float y = mouseY;
float X = pmouseX;
float Y = pmouseY;
strokeWeight(13);
if (mode == 0) {
background(0);
fill(180);
textFont(font);
text("(Color-Me) ABCDE's", 40, 190);
textFont(smaller);
text("Type A-E to turn each page", 50, 230);
text("press & move the mouse to color it", 20, 260);
}
else if (mode ==1 ) { //A
background(255);
pg.beginDraw();
pg.smooth();
pg.strokeWeight(12);
pg.stroke (83, 121, 3);
pg.fill (83, 121, 3);
if (mousePressed == true) {
pg.line(x, y, X, Y);
}
pg.endDraw();
image (pg, 0, 0);
fill (83, 121, 3);
textFont(font, 36);
image(image_a, 0, 70);
text("A is for Avocado", 50, 90);
}
else if (mode == 2 ) { //B
background(255);
pg.beginDraw();
pg.smooth();
pg.strokeWeight(12);
pg.stroke (166, 178, 102);
if (mousePressed == true) {
pg.line(x, y, X, Y);
}
pg.endDraw();
image (pg, 0, 0);
fill (166, 178, 102);
textFont(font);
text("B is for Bamboo", 130, 350);
image(image_b, 0, 0);
}
else if (mode == 3 ) { //C
background(255);
pg.beginDraw();
pg.smooth();
pg.strokeWeight(12);
pg.stroke (197, 52, 26);
pg.fill (83, 121, 3);
if (mousePressed == true) {
pg.line(x, y, X, Y);
}
pg.endDraw();
image (pg, 0, 0);
fill (197, 52, 26);
textFont(font);
text("C is for Chili", 20, 250);
image(image_c, 0, 0);
}
else if (mode == 4 ) { //D
background(255);
pg.beginDraw();
pg.smooth();
pg.strokeWeight(12);
pg.stroke (243, 222, 35);
if (mousePressed == true) {
pg.line(x, y, X, Y);
}
pg.endDraw();
image (pg, 0, 0);
fill (243, 222, 35);
textFont(font);
text("D is for Dandelion", 80, 220);
image(image_d, 0, 50);
}
else if (mode == 5 ) { //E
background(255);
pg.beginDraw();
pg.smooth();
pg.strokeWeight(12);
pg.stroke (73, 19, 71);
if (mousePressed == true) {
pg.line(x, y, X, Y);
}
pg.endDraw();
image (pg, 0, 0);
fill (73, 19, 71);
textFont(font);
text("E is for Eggplant", 70, 320);
image(image_e, 0, 0);
}
else if ( mode == 6) {
background (0);
stroke(255);
textFont(small);
fill(60);
text("F is for Fin, silly.", 60, 200);
}
}
void keyPressed() {
if(key == 'a' || key == 'A') {
mode = 1;
pg.background(255);
}
else if (key == 'b' || key == 'B') {
mode = 2;
pg.background(255);
}
else if (key == 'c' || key == 'C') {
mode = 3;
pg.background(255);
}
else if (key == 'd' || key == 'D') {
mode = 4;
pg.background(255);
}
else if (key == 'e' || key == 'E') {
mode = 5;
pg.background(255);
}
else if (key == 'f' || key == 'F') {
mode = 6;
}
}
Tiffany - F
on Wednesday, Oct 15, 2008 – 2:28 am
2 Comments
this is adorable =)
This is a wonderful project. It has a simple, coherent theme and the addition of drawing / coloring adds a level of engagement. The illustrations are great and the typography is well considered. I suggest making the type a slightly different color for each to create more depth when drawing on top of it.