FANDOM


Returns the location of the mouse pointer.

Syntax:

mouseLoc()

Examples:

the mouseLoc
click at the mouseLoc

Use the mouseLoc function to find out where the mouse is.

The first item of the return value is the horizontal distance in pixels from the left edge of the current stack to the location of the mouse. The second item of the return value is the vertical distance from the top edge of the current stack to the location of the mouse. (Use the defaultStack property to identify the current stack.)

If the mouse is outside the current stack, the values are still correct. For example "-100,-50" means that the mouse is 100 pixels on the left of the current stack and 50 pixels on the top of the current stack.

The first item of the mouseLoc is equal to the mouseH. The second item is equal to the mouseV.

When in a mouseDown handler, you can use the clickLoc function to get the position of the mouse as it was when the mouseDown action occurred.

Tip: The mouseMove message sends the current mouse position as a parameter. This means that in a mouseMove handler, normally it's not necessary to use the mouseLoc function.

See also: mouseV (function), mouseColor (function), mouseClick (function), mouseH (function), clickLoc (function), mouseLoc (function), selectedLoc (function), mouseCharChunk (function), dragEnter (message), mouseMove (message), stack (object)