xxxxxxxxxx
62
let IB;
let F1;
function preload(){
IB=loadImage("IB.jpg");
F1=loadFont("Font1.ttf");
}
class ipage{
constructor(){
this.BG=IB;
this.F1=F1;
this.slider=createSlider(1,8,1);
this.lvl=1;
this.playbool=false;
}
show(){
//this.BG.resize(width,height);
image(this.BG,0,0);
textSize(70);
textFont(this.F1)
textAlign(CENTER);
fill(100);
text("DROP",200,200);
rectMode(CENTER);
fill(255,255,0);
rect(200,250,30,100,15);
rectMode(CORNER);
this.showlvl();
this.playbox();
return this.playbool;
}
showlvl(){
this.lvl=this.slider.value()
this.slider.position(10, 470);
this.slider.style('width', '80px');
fill(0);
textAlign(LEFT);
textSize(20);
text("Level",5,440);
textSize(30);
text(":",5,470);
text(this.lvl,30,470);
}
playbox(){
fill(100);
if(mouseX>200&&mouseX<350&&mouseY>400&&mouseY<480){
fill(70);
}
rect(200,400,150,80,30);
fill(0);
text("Play",218,457)
if(mouseX>200&&mouseX<350&&mouseY>400&&mouseY<480&&mouseIsPressed){
this.playbool=true;
}
}
getlvl(){
return this.lvl;
}
}