Hello everybody. I was trying to make a simple, UI-based sketch where I am trying display ascII characters by sifting through them using a ‘slider’. But, I’ve got stuck. Any help?
stroke (255);
noFill ();
rect (rectX, rectY, rectW, rectH);
if (mousePressed) {
if (linePos <= rectY) {
linePos = rectY;
} else if (linePos >= lineY) {
linePos = lineY;
}
g = map (mouseY, height, 0, 0, 255);
linePos = g;
int i = int (g);
char c = char (i);
text(c, 20, 75);
}
stroke (255, 0, 0);
line (rectX, linePos, lineX, linePos);