GSDP:GAM100/CProcessing/CP Input GetMouseWorldY()
< GSDP:GAM100 | CProcessing
CP_Input_GetMouseWorldY()
Description
The function CP_Input_GetMouseWorldY() always returns the current vertical coordinate of the mouse in world space. This means that the mouse position will be translated by any transformation functions called (CP_Settings_Translate() , CP_Settings_Scale() , CP_Settings_ScaleX() , CP_Settings_ScaleY() , CP_Settings_Rotate()). 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_Settings_Translate(CP_Input_GetMouseX(), CP_Input_GetMouseY());
CP_Graphics_DrawLine(0, 0, CP_Input_GetMouseWorldX(), CP_Input_GetMouseWorldY());
}
See Also
- Main Page
- CP_Input_GetMouseX()
- CP_Input_GetMouseY()
- CP_Input_GetMousePreviousX()
- CP_Input_GetMousePreviousY()
- CP_Input_GetMouseWorldX()
- CP_System_GetCanvasHeight()
- CP_System_GetCanvasWidth()
- CP_Settings_Background()
- CP_Color_Create()
- CP_Graphics_DrawLine()
- CP_Settings_Translate()
- CP_Settings_Scale()
- CP_Settings_ScaleX()
- CP_Settings_ScaleY()
- CP_Settings_Rotate()