(Formerly known as global function GetHotspotAt, which is now obsolete)
static Hotspot* Hotspot.GetAtScreenXY(int x, int y)
Returns the hotspot at SCREEN co-ordinates (X,Y).
If there is no hotspot there, or if invalid co-ordinates are specified,
the Hotspot* representing hotspot 0 will be returned.
NOTE: The co-ordinates are SCREEN co-ordinates, NOT ROOM co-ordinates. This
means that with a scrolling room, the co-ordinates you pass are relative to
the screen's current position, and NOT absolute room co-ordinates. This
means that this function is suitable for use with the mouse cursor position
variables.
Example:
if (Hotspot.GetAtScreenXY(mouse.x, mouse.y) == hDoor)
Display("Mouse on the door");
else if (Hotspot.GetAtScreenXY(mouse.x, mouse.y) != hotspot[0])
Display("Mouse is on something (but not the door)!");
else
Display("Mouse not on a hotspot");
will display a message depending on what the mouse is on.
See Also: Game.GetLocationName, GetLocationType
|