Files
GravityDev3/mGui.pde
2022-03-31 15:01:31 -04:00

51 lines
775 B
Plaintext

/*
Actual GUI file that defines all gui elements
*/
class Gui {
CButton cb;
Gui(){
cb = new CButton();
}
void display(){
cb.display();
}
boolean clickManager(Vector mouse){
return cb.clicked(mouse.x,mouse.y);
}
}
//Center button
class CButton extends Button{
CButton(){
pos = new Vector(width/2,15);
dim = new Vector(70,24);
t = "center";
tSize = 20;
}
void display(){
fill(col);
rectMode(CENTER);
rect(pos.x,pos.y,dim.x,dim.y,rad);
fill(tCol);
textAlign(CENTER,CENTER);
textSize(tSize);
text(t,pos.x,pos.y - tSize/4);
}
boolean clicked(float mx, float my){
if(mouseOver(mx,my)){
flags.centerOnFocus = true;
return true;
}else{return false;}
}
}