//slider values: 0: value, 1: x-position, 2: y-position 3: locked, 4: hovered float[] slider1 = {10,15,10,0,0}; float[] slider2 = {10,30,10,0,0}; float[] slider3 = {10,45,10,0,0}; int[] colorvalue = {0,0,0}; int numberofrows = 13; int numberofcolumns = 13; int radiusx; int radiusy; int positionx; int positiony; color[][] dotsmatrix = new color[numberofrows][numberofcolumns]; color defaultcolor = color(100); int currentcolumn = 0; int currentrow = 0; float[][] sliders = {slider1, slider2, slider3}; int current = sliders.length+1; //drawing constants int slider = 10; int sizeheight = 400; int sizewidth = 400; int buttonwidth = 35; int buttonheight = 20; void setup() { size(sizewidth,sizeheight); background(defaultcolor); rectMode(CENTER_RADIUS); ellipseMode(CENTER); smooth(); for (int i=0; i=(sliders[i][1]-slider) && mouseY<=(sliders[i][2]+slider) && mouseY>=(sliders[i][2]-slider)) {sliders[i][4] = 1;} //set "hovered" to true else sliders[i][4] = 0; if (mousePressed && sliders[i][4]==1 && (current==i||current==(sliders.length+1))) { // sliders[i][3] = 1; //set "locked" to true current = i; //and set this slider as current } } if (current <= sliders.length) { sliders[current][2] = constrain(sliders[current][2]-(pmouseY-mouseY), 10, sizeheight-10); } for (int i=0; isizewidth-buttonwidth && mouseY > sizeheight-buttonheight) nextDot(); else if (mouseX>sizewidth-(2*buttonwidth) && mouseX sizeheight-buttonheight) previousDot(); else if (mouseX>sizewidth-(3*buttonwidth) && mouseX sizeheight-buttonheight) upDot(); else if (mouseX>sizewidth-(4*buttonwidth) && mouseX sizeheight-buttonheight) downDot(); } void nextDot(){ if (currentcolumn + 1 < numberofcolumns) currentcolumn++; else if (currentrow+1 = 0) currentcolumn--; else if (currentrow-1>=0) {currentcolumn=numberofcolumns-1; currentrow--;} else {currentcolumn = numberofcolumns-1; currentrow = numberofrows-1;} } void upDot(){ if (currentrow - 1 >= 0) currentrow--; else if (currentcolumn-1>=0) {currentrow=numberofrows-1; currentcolumn--;} else {currentrow = numberofrows-1; currentcolumn = numberofcolumns-1;} } void downDot(){ if (currentrow + 1 < numberofrows) currentrow++; else if (currentcolumn + 1