It's kind of hard to understand what you're trying to achieve from lack of information, but I believe translate() and scale() might be what you're looking for. Other than just scaling your coordinate system (scaling everything you draw after scale()) you can also invert the coordinate system. Using this while translated to the center of the screen would flip everything.
For example if you had
- void setup() {
- size(200,200);
- background(255);
- noStroke();
- }
- void draw() {
- translate(width/2,height/2); // Set 0,0 to the center of the sketch
- fill(0,0,255); // Blue box
- rect(-60,-60,20,20);
- }
You could flip this on the x-axis by doing
- void setup() {
- size(200,200);
- background(255);
- noStroke();
- }
- void draw() {
- translate(width/2,height/2); // Set 0,0 to the center of the sketch
- fill(0,0,255); // Original blue box
- rect(-60,-60,20,20);
-
- scale(-1,1); // Multiply every x from this point on by -1, making it -x
-
- fill(255,0,0); // New red box
- rect(-60,-60,20,20);
- }
And you could do the same on the y-axis by using scale(1,-1). Just remember that in processing y goes down as it's increasing and up as it's decreasing, which can easily confuse if you're not used to it.
As a side-note you should only ever have one draw method.