Difference between revisions of "GSDP:GAM100/CProcessing/CP Input GetMouseWorldY()"

From Inside
Jump to: navigation, search
>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
 
(One intermediate revision by the same user not shown)
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 ==
Line 14: Line 14:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
==== Related ====
+
== See Also ==
* [[GSDP:GAM100/CProcessing                            |Main Page           ]]
+
* [[GSDP:GAM100/CProcessing                            |Main Page                   ]]
* [[GSDP:GAM100/CProcessing/CP_Input_GetMouseX()        |CP_Input_GetMouseX()]]
+
* [[GSDP:GAM100/CProcessing/CP_Input_GetMouseX()        |CP_Input_GetMouseX()       ]]
* [[GSDP:GAM100/CProcessing/CP_Input_GetMouseY()        |CP_Input_GetMouseY() ]]
+
* [[GSDP:GAM100/CProcessing/CP_Input_GetMouseY()        |CP_Input_GetMouseY()       ]]
 
* [[GSDP:GAM100/CProcessing/CP_Input_GetMousePreviousX()|CP_Input_GetMousePreviousX()]]
 
* [[GSDP:GAM100/CProcessing/CP_Input_GetMousePreviousX()|CP_Input_GetMousePreviousX()]]
 
* [[GSDP:GAM100/CProcessing/CP_Input_GetMousePreviousY()|CP_Input_GetMousePreviousY()]]
 
* [[GSDP:GAM100/CProcessing/CP_Input_GetMousePreviousY()|CP_Input_GetMousePreviousY()]]
* [[GSDP:GAM100/CProcessing/CP_Input_GetMouseWorldX()  |CP_Input_GetMouseWorldX()]]
+
* [[GSDP:GAM100/CProcessing/CP_Input_GetMouseWorldX()  |CP_Input_GetMouseWorldX()   ]]
* [[GSDP:GAM100/CProcessing/CP_Settings_Background()    |CP_Settings_Background()             ]]
+
* [[GSDP:GAM100/CProcessing/CP_System_GetCanvasHeight() |CP_System_GetCanvasHeight() ]]
* [[GSDP:GAM100/CProcessing/CP_Settings_Translate()    |CP_Settings_Translate()               ]]
+
* [[GSDP:GAM100/CProcessing/CP_System_GetCanvasWidth()  |CP_System_GetCanvasWidth()  ]]
* [[GSDP:GAM100/CProcessing/CP_Settings_Scale()        |CP_Settings_Scale()               ]]
+
* [[GSDP:GAM100/CProcessing/CP_Settings_Background()    |CP_Settings_Background()   ]]
* [[GSDP:GAM100/CProcessing/CP_Settings_ScaleX()        |CP_Settings_ScaleX()               ]]
+
* [[GSDP:GAM100/CProcessing/CP_Color_Create()          |CP_Color_Create()          ]]
* [[GSDP:GAM100/CProcessing/CP_Settings_ScaleY()        |CP_Settings_ScaleY()               ]]
+
* [[GSDP:GAM100/CProcessing/CP_Graphics_DrawLine()      |CP_Graphics_DrawLine()      ]]
* [[GSDP:GAM100/CProcessing/CP_Settings_Rotate()        |CP_Settings_Rotate()               ]]
+
* [[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()       ]]

Latest revision as of 15:07, 3 July 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());
}

See Also

Personal tools
Namespaces

Variants
Actions
Navigation
NameSpaces:>
Tools
Dynamic:>