Seemingly Room: Processing

Images:

When mouse is not moved
An image appears when the mouse is moved

Codes:

PImage p1, p2;
PImage [] picArray = new PImage [2];

void setup(){
size (1283, 1897);
p1 = loadImage(“human.jpg”);
p2 = loadImage(“human4.jpg”);
picArray[0] = p1;
picArray[1] = p2;

background(255);
}

void draw(){
image(p1, 0, 0);
line(0, 1000, 700, 1500);
line(700, 1500, 1283, 1100);
line(700, 1500, 700, 1897);
}

void mouseMoved(){
image(picArray[1], mouseX, mouseY);
}

Pictures used:

human.jpeg
human4.jpg
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s