mirror of
https://github.com/opus-tango/B12NumbersV3.git
synced 2026-03-20 12:05:21 +00:00
1.0.0.0 - First full release!
This commit is contained in:
27
B12NumbersV3/MathDisplay.pde
Normal file
27
B12NumbersV3/MathDisplay.pde
Normal file
@@ -0,0 +1,27 @@
|
||||
class MathDisplay {
|
||||
/*
|
||||
Displays a B12Expression
|
||||
*/
|
||||
PVector pos;
|
||||
B12Expression ex;
|
||||
|
||||
MathDisplay(B12Expression _ex){
|
||||
ex = _ex;
|
||||
pos = new PVector(0,0);
|
||||
}
|
||||
|
||||
PVector getPos(){ return pos; }
|
||||
MathDisplay setPos(PVector _pos){ pos = _pos; return this;}
|
||||
|
||||
void display(){
|
||||
pushMatrix();
|
||||
translate(pos.x,pos.y);
|
||||
int count = 0;
|
||||
for(int i = ex.length() - 1; i >= 0 ; i--){
|
||||
ex.getDigit(i).setPos((-12 * (count+1)), 0);
|
||||
ex.getDigit(i).display();
|
||||
count++;
|
||||
}
|
||||
popMatrix();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user