xxxxxxxxxx
54
/*
* @name Load and Display Image
* @description Images can be loaded and displayed to the screen at their
* actual size or any other size.
* <p><em><span class="small"> To run this example locally, you will need an
* image file, and a running <a href="https://github.com/processing/p5.js/wiki/Local-server">
* local server</a>.</span></em></p>
*/
let img; // Declare variable 'img'.
fontsize = 20;
function setup() {
createCanvas(800, 600);
door = loadImage('https://66.media.tumblr.com/652ce73b71751b321d975238b61f3f11/tumblr_ppk6zrxeYN1xsr2vuo1_540.png'); // Load the image
den = loadImage('https://66.media.tumblr.com/934eefcfff483e09d59b3cca0f146f9d/tumblr_ppk6zrxeYN1xsr2vuo3_r1_540.png'); // Load the image
kias = loadImage('https://66.media.tumblr.com/d9ae15785596958a0b5bdfbad3249079/tumblr_ppk6zrxeYN1xsr2vuo2_r1_540.png'); // Load the image
//cake = loadImage('https://66.media.tumblr.com/a442ad2e9f1642cb16ac6b73adfa713f/tumblr_pne7hl6KyW1xsr2vuo2_250.png'); // Load the image
textFont("Georgia");
textSize(36);
//textAlign(CENTER);
}
function draw() {
// Displays the image at its actual size at point (0,0)
//tint('#A4A4A4'); // Tint blue
translate(width/2,height/2);
scale(0.5);
imageMode(CENTER);
image(door, 0, 0);
if (mouseIsPressed) {
scale(0.4);
image(kias, 0, 0,);
}
else{
scale(0.4);
image(den,0,0);
}
//function mouseClicked() {
//image(kias, 0, 0,);
///}
// Displays the image at point (0, height/2) at half size
//image(cake, mouseX, mouseY,cake.width / 5, cake.height/5);
//text('πήρα το ρίνγκ και μετά το ες μπαν', mouseX, mouseY+20);
}