xxxxxxxxxx
61
/*
* @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'.
let photoY=380;
fontsize = 20;
function setup() {
createCanvas(540, 400);
txt = loadImage('https://66.media.tumblr.com/f19f097003acf84ed7d183cba72f46f8/tumblr_pwj9t4igNC1xsr2vuo1_540.png'); // Load the image
rizes = loadImage('https://66.media.tumblr.com/ad11fd7254d371b7c1b8c6ecc3b1958a/tumblr_pwja4eT1Ke1xsr2vuo1_540.jpg'); // 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);
push();
//imageMode(CENTER);
image(rizes,0,0);
pop();
image(txt, 0, photoY);
}
function keyPressed(){
if(keyCode==RIGHT_ARROW){
photoY=photoY-10;
}
if(keyCode==LEFT_ARROW){
photoY=photoY+10;
}
//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);
}