Target

(Engine-Level Function)

Description: Returns an indication of whether the locator (e.g. mouse) is within a specified screen area.
Returns: Boolean
Usage: Script or steady state.
Function Groups: Locator
Related to: Click | Pick | SetXLoc | SetYLoc | XLoc | YLoc | GUITransform
Format: Target(X1, Y1, X2, Y2)
Parameters:  
X1
Required. Any numeric expression giving the X coordinate on the screen of one side of the screen area ("target").
Y1
Required. Any numeric expression giving the Y coordinate on the screen of either the top or bottom of the screen area ("target").
X2
Required. Any numeric expression giving the X coordinate on the screen of the side of the "target" opposite to X1.
Y2
Required. Any numeric expression giving the Y coordinate on the screen of either the top or bottom of the target, whichever is the opposite of Y1.
Comments:

This function returns true if the locator position is within the boundaries of the "target" ((X1,Y1) - (X2,Y2)). If the locator is not installed, the function will return false (0).

Note: This function is disabled when using a GUITransform as a GUIStrectch.

Example:

If Target(120, 50, 220, 80);
[
   ...
]

This statement will cause the script to execute whenever the mouse passes over the target area.