GSDP:GAM100/CProcessing/CP Input GetMouseX()

CP_Input_GetMouseX()

Description

The system variable CP_Input_GetMouseX() always contains the current horizontal coordinate of the mouse. This will track the position of the mouse anywhere on the screen, even if the window is in the background.

Example

void draw() 
{
  CP_Settings_Background(CP_Color_Create(200, 200, 200, 255));
  CP_Graphics_DrawLine(CP_Input_GetMouseX(), 20, CP_Input_GetMouseX(), 80);
}

See Also