(Formerly known as GetGUIAt, which is now obsolete)
static GUI* GUI.GetAtScreenXY(int x, int y)
Checks whether there is currently a GUI at screen co-ordinates (X,Y). If
there is, returns its GUI. If two GUIs overlap, the frontmost one will
be returned - this can be changed with the GUI.ZOrder property.
If there is not currently a displayed, clickable GUI at the location then
null is returned. If null is returned, do NOT attempt to call any methods
or use any properties of the GUI (since it does not actually exist).
NOTE: This command will not find any GUIs that are set as Non-Clickable (ie.
the "Clickable" checkbox not checked).
Example:
GUI *theGui = GUI.GetAtScreenXY(mouse.x, mouse.y);
if (theGui == gInventory) {
Display("Inventory GUI at mouse location.");
}
else if (theGui == null) {
Display("No GUI at mouse location");
}
else {
Display("GUI %d at mouse location.", theGui.ID);
}
will display the number of the GUI that the mouse is over.
See Also: GUIControl.GetAtScreenXY, GUI.ID,
GUI.ZOrder
|