spacer graphic
spacer graphic
Montage of games AGS Logo
spacer graphic

 

spacer graphic
Menu
spacer graphic Home
About
News
Features
Download AGS
spacer graphic Games 
Games main page
Award Winners
Picks of the month
Short games
Medium length games
Full length games
In Production
Hints & Tips
Community
Forums
AGSers World Map
Member websites
Chat
Resources
Tutorials
FAQ
Knowledge Base
Downloads
Links
AGS-related links
* AGS Manual
  * Scripting
    * Hotspot functions and properties

GetAtScreenXY (hotspot)

(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


User comments and notes
There are currently no user comments on this page.
The user comment facility is currently disabled.