class Selector{ int x, y, x2, y2; color fillColor; int fillAlpha; public Selector(int _x, int _y){ x = _x; y = _y; fillColor = #ff99ff; fillAlpha = 20; } void update(){ rectMode(CORNERS); noStroke(); fill(fillColor, fillAlpha); x2 = mouseX; y2 = mouseY; rect(x, y, x2, y2); } void checkCoor(){ if(x>x2){ int fx = x; x = x2; x2 = fx; } if(y>y2){ int fy = y; y = y2; y2 = fy; } } }