mirror of
https://github.com/opus-tango/GravityDev3.git
synced 2026-03-20 03:55:24 +00:00
Initial commit
This commit is contained in:
49
mGui.pde
Normal file
49
mGui.pde
Normal file
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
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;}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user