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
    * Game / Global functions

GetLocationName

(Formerly known as global function GetLocationName, which is now obsolete)

static String Game.GetLocationName(int x, int y)
Returns the name of whatever is on the screen at (X,Y). This allows you to create the Lucasarts-style status lines reading "Look at xxx" as the player moves the cursor over them.

NOTE: Unlike ProcessClick, this function actually works on what the player can see on the screen - therefore, if the co-ordinates are on a GUI, a blank string is 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:

String location = Game.GetLocationName(mouse.x, mouse.y);
will get the name of whatever the mouse is over into the string variable.

See Also: Hotspot.Name, InventoryItem.Name, GetLocationType, Object.Name


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