class Slider{ int x,y,w,h,cb; // cb is the clickBorder float maxVal, minVal, value; color cStroke, cFill; //------------------------------------------------ Slider(int x, int y, int w, int h, float minVal, float maxVal, float value) { this.x = x; this.y = y; this.w = w; this.h = h; this.maxVal = maxVal; this.minVal = minVal; this.value = value; this.cStroke = color(64); this.cFill = color(255,64); cb = 3; } //------------------------------------------------ void visualize() { fill(cStroke); stroke(cStroke); rect(x,y,w,h); fill(cFill); rect(x,y+h-h*(value-minVal)/(maxVal-minVal),w,h*(value-minVal)/(maxVal-minVal)); } //------------------------------------------------ float mouseInput(int mX, int mY) { if(mX>x-cb && mXy && mYx-cb && mXy && mY