GetMouseY

From Spheriki

Jump to: navigation, search

Gets the y coordinate of the mouse relative to the top-left corner of the Sphere video display.

Contents

Usage

number GetMouseY();

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.

Notes

  • There is a corresponding function GetMouseX(), which gets the x coordinate.

See also

Personal tools