xxxxxxxxxx
48
/*
* @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=1700;
fontsize = 20;
function setup() {
createCanvas(540, 400);
txt = loadImage('kimolo exarxeia-1.png'); // Load the image
rizes = loadImage('kimolosdark.png'); // Load the image
textFont("Georgia");
textSize(36);
//textAlign(CENTER);
}
function draw() {
//imageMode(CENTER);
push();
//imageMode(CENTER);
image(rizes,0,0);
pop();
scale(0.2);
image(txt, 0, photoY);
}
function keyPressed(){
if(keyCode==RIGHT_ARROW){
photoY=photoY-100;
}
if(keyCode==LEFT_ARROW){
photoY=photoY+100;
}
}