GSDP:GAM100/CProcessing/CP Input GetMouseWorldY()
From Inside
< GSDP:GAM100 | CProcessing
Revision as of 12:14, 26 June 2020 by >J.thiel (New page: = 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 mous...)
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());
}