xxxxxxxxxx
17
function setup() {
createCanvas(240, 120);
strokeWeight(12);
}
function draw() {
background(220);
stroke(255);
line(mouseX, 0, mouseX, height); // white line
// var mx = mouseX/2 + 60;
// example: mouseX at 200, mx at 160 (offsetting)
var mx = map(mouseX, 0, width, 60, 180);
stroke(0);
line(mx, 0, mx, height); // black line
}