Files
B12NumbersV3/B12NumbersV3/B12Button.pde
2022-05-20 16:46:13 -04:00

34 lines
703 B
Plaintext

class B12Button extends Button{
/*
A button that can render a B12Digit instead of text
*/
B12Digit digit;
B12Button(MouseHandler _mh, B12Digit _digit){
super(_mh);
digit = _digit;
setData(_digit);
}
// GETTERS AND SETTERS //
B12Digit getDigit(){ return digit; }
B12Button setDigit(B12Digit _digit){ digit = _digit; return this; }
// Add drawing the B12Digit to the display method
@Override
void display(){
super.display();
pushMatrix();
translate(super.pos.x,super.pos.y);
switch(super.mode){
case CORNER: digit.setPos(super.dim.x/2 - 4, super.dim.y - 2);
}
digit.display();
popMatrix();
}
}