xxxxxxxxxx
93
/*Final Project Pitch Template*/
var currentSlide = 1;
var totalSlides = 3 ;
var nextSlideActive = false;
var prevSlideActive = false;
//slide2
var description = "My final project combines interaction, landscape, and a sound sampler, which I enjoyed the most and took the most time to create. Sometimes, I struggled with the assignment to complete, but now that I look back, it was pretty easy! ";
function setup() {
createCanvas(400, 400);
textFont("Quicksand");
}
function draw() {
background("lightsalmon");
//fist slide
if (currentSlide ==1){
textAlign(CENTER,CENTER);
textSize(40);
fill("ivory")
text('MMP 200', width / 2, height /2.6);
text('My Final Project', width / 2, height /2);
text('✿ Sujin ✿', width / 2,height / 2+50);
}
if(currentSlide ==2){
textSize(20);
textAlign(LEFT);
text(description,50,50,300);
}
if(currentSlide ==3){
}
nextSlideActive = button(300, 350, 60, 20, "Next");
prevSlideActive = button(50, 350, 60, 20, "Prev");
}
function mousePressed() {
if (nextSlideActive && currentSlide < totalSlides) {
currentSlide += 1;
}
if (prevSlideActive && currentSlide > 1) {
currentSlide -= 1;
}
}
//draws a button , returns whether it is active
function button(x,y,w,h,txt){
var isActive = false;
if (mouseX > x && mouseX < x + w &&
mouseY > y && mouseY < y + h ){
isActive = true;
fill("pink");
} else{
fill("white")
}
rect(x,y,w,h);
textSize(h);
fill(0);
textStyle(NORMAL);
textAlign(LEFT,TOP);
text(txt,x+10,y+2);
return isActive;
}