Difference between revisions of "Legacy:GetMouseX"

From Spherical
Jump to: navigation, search
(Created page with "{{subst:functemp}}")
 
Line 1: Line 1:
  
  
{{{preamble}}}
+
Returns the X coordinate of the pixel the mouse is currently over in the game window or (in fullscreen) screen.
  
 
__TOC__
 
__TOC__
  
 
==Usage==
 
==Usage==
{{Usage|returns={{{returns}}}|object={{{object}}}|func={{{function}}}|params={{{params}}}}}
+
{{Usage|returns=X|func=GetMouseX}}
  
* '''param1''' type. param1 description
+
==Examples==
* '''param2''' type. param2 description
+
Color the pixel on the screen that the mouse is currently on:
* '''paramN''' type. paramN description
 
  
==Examples==
+
<syntaxhighlight>
(examples with syntaxhighlighted code)
+
var Red = CreateColor(255, 0, 0, 255);
 +
Point(GetMouseX(), GetMouseY(), Red);
 +
</syntaxhighlight>
  
 
==Notes==
 
==Notes==
(notes)
+
Mouse coordinates will not be tracked when the mouse is out of the window.
  
 
==See also==
 
==See also==
* see also
+
 
* see also
+
* [[API:GetMouseY|GetMouseY]]()
* see also
+
* [[API:SetMousePosition|SetMousePosition]](x, y)
* etc
 

Revision as of 12:25, 8 September 2013


Returns the X coordinate of the pixel the mouse is currently over in the game window or (in fullscreen) screen.

Usage

X GetMouseX();


Examples

Color the pixel on the screen that the mouse is currently on:

var Red = CreateColor(255, 0, 0, 255);
Point(GetMouseX(), GetMouseY(), Red);

Notes

Mouse coordinates will not be tracked when the mouse is out of the window.

See also