Difference between revisions of "GSDP:GAM100/CProcessing/CP Input GetMouseWorldY()"
From Inside
< GSDP:GAM100 | CProcessing
>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...) |
>J.thiel |
||
Line 2: | Line 2: | ||
== Description == | == 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 ([[GSDP:GAM100/CProcessing/CP_Settings_Translate() |CP_Settings_Translate() ]], [[GSDP:GAM100/CProcessing/CP_Settings_Scale() |CP_Settings_Scale() ]], [[GSDP:GAM100/CProcessing/CP_Settings_ScaleX() |CP_Settings_ScaleX() ]], [[GSDP:GAM100/CProcessing/CP_Settings_ScaleY() |CP_Settings_ScaleY() ]], [[GSDP:GAM100/CProcessing/CP_Settings_Rotate() |CP_Settings_Rotate()]]). This will track the position of the mouse anywhere on the screen, even if the window is in the background. | + | 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 ([[GSDP:GAM100/CProcessing/CP_Settings_Translate() |CP_Settings_Translate() ]], [[GSDP:GAM100/CProcessing/CP_Settings_Scale() |CP_Settings_Scale() ]], [[GSDP:GAM100/CProcessing/CP_Settings_ScaleX() |CP_Settings_ScaleX() ]], [[GSDP:GAM100/CProcessing/CP_Settings_ScaleY() |CP_Settings_ScaleY() ]], [[GSDP:GAM100/CProcessing/CP_Settings_Rotate() |CP_Settings_Rotate()]]). This will track the position of the mouse anywhere on the screen, even if the window is in the background. |
== Example == | == Example == |
Revision as of 13:39, 26 June 2020
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());
}