Built-in Variables (pmouseX, pmouseY) - Processing Tutorial

edited September 2016 in Hello Processing

I am following Daniel Shiffman's intro tutorial on using (pmouseX, pmouseY) to draw a continuous line as the curser moves across the screen. However, while his version of the line is solid, when I ran my codes the lines are discontinuous and spotty. Is this an issue with my codes or a bug in the program? Thanks!

1

Tagged:

Answers

  • Hi ceetee -- that should be

    line(mouseX, mouseY, pmouseX, pmouseY);
    

    "draw a line from current mouse position x1,y1 to previous mouse position x2,y2."

    You are drawing a line from the previous mouse position to itself. A line drawn from x,y to itself is a dot!

Sign In or Register to comment.