GetMouseY
From Spheriki
Gets the y coordinate of the mouse relative to the top-left corner of the Sphere video display.
Contents |
[edit]
Usage
number GetMouseY();
[edit]
Examples
var my = GetMouseY();
Gets the mouse's y coordinate, and places it in the variable my.
var scr_w = GetScreenWidth();
var white = CreateColor(255, 255, 255);
var f = GetSystemFont();
while (AreKeysLeft()) GetKey();
while (!AreKeysLeft())
{
f.drawText(0, 0, "Press any key to end.");
var my = GetMouseY();
Line(0, my, scr_w, my, white);
FlipScreen();
}
Draws a solid horizontal white line displaying the current y position of the mouse cursor.
[edit]
Notes
- There is a corresponding function GetMouseX(), which gets the x coordinate.
- To set or change the position of the mouse, use SetMousePosition().
[edit]
See also
- AreKeysLeft()
- CreateColor()
- FlipScreen()
- Font.drawText()
- GetKey()
- GetScreenWidth()
- GetSystemFont()
- Line()

