GSDP:GAM100/CProcessing/pmouseX

pmouseX

Description

The system variable pmouseY always contains the previous horizontal coordinate of the mouse. This value will be the same as pmouseY the previous frame. This will track the position of the mouse anywhere on the screen, even if the window is in the background.

Example

void draw() 
{
  background(color(200, 200, 200, 255));
  line(mouseX, mouseY, pmouseX, pmouseY);
}

Related