The midterm (final)

ex

ex1

 

ex3

 

This work has been developed more from the last week. The concept of this project is now collaborated with an idea of ‘memo’ next to the world map. While different flags appear, one can memo on the illustration board.

Changes:

-Size of the map

-Illustration board

 

Problems:

-Image for background of the illustration board does not load

-Code for text to disappear when an image of flag loads

 

Code

 

/* @pjs preload= “worldmap.png”; */
/* @pjs preload= “mogolia.jpg”; */
/* @pjs preload= “ukraine.jpg”; */
/* @pjs preload= “cuba.jpg”; */
/* @pjs preload= “Unknown.jpg”; */
/* @pjs preload= “madagascar-flag.gif”; */
/* @pjs preload= “fiji.jpg”; */

PImage img;
PImage bg;
int x;
int y;
color pix;
float pointillize = 2;
int value = 0;
void setup() {
size(1300, 620);
{img = loadImage(“worldmap.png”);
//image(img, 0, 0);
imageMode(CORNER);
image(img,0,0, 960,620);
noStroke();}
{
bg = loadImage(“Notebook Paper 2.jpg”);

imageMode(CORNER);
image(img,340,620,960,620);
}

}

void draw() {

{stroke(0);
strokeWeight(2);

if (mousePressed == true) {
line(mouseX, mouseY, pmouseX, pmouseY);
}
}

//asia
image(img,0,0, 960,620); // We don’t need this anymore becayse we are drawing our own pixels
{{ if (mousePressed && (mouseButton == LEFT)) {
if (mouseX >= 600 && mouseX <= 920) {
if (mouseY >= 0 && mouseY <=310) {
img = loadImage(“mogolia.jpg”);
} else {
value = 0 ;
}
}
}
}

//europe
image(img,0,0, 960,620); // We don’t need this anymore becayse we are drawing our own pixels
{if (mousePressed && (mouseButton == LEFT)) {
if (mouseX >= 400 && mouseX <= 600) {
if (mouseY >= 0 && mouseY <=200) {
img = loadImage(“ukraine.jpg”);
} else {
value = 0 ;
}
}
}
}
//america
image(img,0,0, 960,620); // We don’t need this anymore becayse we are drawing our own pixels
{if (mousePressed && (mouseButton == LEFT)) {
if (mouseX >= 0 && mouseX <= 300) {
if (mouseY >= 0 && mouseY <=240) {
img = loadImage(“cuba.jpg”);
} else {
value = 0 ;
}
}
}
}
//south america
image(img,0,0, 960,620); // We don’t need this anymore becayse we are drawing our own pixels
{if (mousePressed && (mouseButton == LEFT)) {
if (mouseX >=100 && mouseX <=340) {
if ( mouseY >=350 && mouseY <= 960) {
img = loadImage(“Unknown.jpg”);
} else {
value = 0 ;
}
}
}
}

//africa
image(img,0,0, 960,620);// We don’t need this anymore becayse we are drawing our own pixels
if (mousePressed && (mouseButton == LEFT)) {
if (mouseX >= 400 && mouseX <= 600) {
if (mouseY >= 240 && mouseY <=900) {
img = loadImage(“madagascar-flag.gif”);
} else {
value = 0 ;
}

}

//austrailia
image(img,0,0, 960,620);// We don’t need this anymore becayse we are drawing our own pixels
if (mousePressed && (mouseButton == LEFT)) {
if (mouseX >= 760 && mouseX <= 910) {
if (mouseY >= 400 && mouseY <=960) {
img = loadImage(“fiji.jpg”);
} else {
value = 0 ;
}

}
}
}
img = loadImage(“worldmap.png”);
///////////////////text///////////////////

//asia

if (mouseX >= 600 && mouseX <= 920) {
if (mouseY >= 0 && mouseY <=310) {
fill(0);
textSize(15);
text(“asia”, mouseX, mouseY);
}
}

//europe
if (mouseX >= 400 && mouseX <= 600) {
if (mouseY >= 0 && mouseY <=200) {
fill(0);
textSize(15);
text(“europe”, mouseX, mouseY);
}
}
//africa
if (mouseX >= 400 && mouseX <= 600) {
if (mouseY >= 240 && mouseY <=900) {
fill(0);
textSize(15);
text(“africa”, mouseX, mouseY);
}
}

//austrailia
if (mouseX >= 760 && mouseX <= 910) {
if (mouseY >= 400 && mouseY <=960) {
fill(0);
textSize(15);
text(“austrailia”, mouseX, mouseY);
}
}

//america
if (mouseX >= 0 && mouseX <= 300) {
if (mouseY >= 0 && mouseY <=240) {
fill(0);
textSize(15);
text(“america”, mouseX, mouseY);
}
}

//south america
if (mouseX >=100 && mouseX <=340) {
if ( mouseY >=350 && mouseY <= 960) {
fill(0);
textSize(15);
text(“south america”, mouseX, mouseY);
}
}
}
}

This entry was posted in Uncategorized on by .

About yerangchoi

Hi, I am Yerang. I am originally from South Korea but lived the past 4 years in India before moving to New York. Coding only exists for tumblr to me and I know very little about it. To be honesty, I was not excited for spending hours and hours in front of computer like a nerd, but I am now have excitement for creating fantastic things in this class.