GSDP:GAM100/CProcessing/CP Input GetMousePreviousY()



The function CP_Input_GetMousePreviousY() always returns the previous vertical coordinate of the mouse. This value will be the same as CP_Input_GetMouseY() the previous frame. This will track the position of the mouse anywhere on the screen, even if the window is in the background.


void draw() 
  CP_Settings_Background(CP_Color_Create(200, 200, 200, 255));
  CP_Graphics_DrawLine(CP_Input_GetMouseX(), CP_Input_GetMouseY(), CP_Input_GetMousePreviousX(), CP_Input_GetMousePreviousY());

See Also