Contents Up Previous Next

Hotspot functions and properties

GetAtScreenXY (hotspot)
GetName (hotspot)
GetProperty (hotspot)
GetPropertyText (hotspot)
RunInteraction (hotspot)
Enabled property (hotspot)
ID property (hotspot)
WalkToX property
WalkToY property


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: GetLocationName, GetLocationType


GetName (hotspot)

(Formerly known as GetHotspotName, which is now obsolete)

Hotspot.GetName(string buffer)
Copies the name of the hotspot into BUFFER.

Example:

string buffer;
hotspot[3].GetName(buffer);
Display("Hotspot 3's name is %s.", buffer);
will retrieve and then display hotspot 3's name.

See Also: GetLocationName


GetProperty (hotspot)

(Formerly known as GetHotspotProperty, which is now obsolete)

Hotspot.GetProperty(string property)
Returns the custom property setting of the PROPERTY for the hotspot.

This command works with Number properties (it returns the number), and with Boolean properties (returns 1 if the box was checked, 0 if not).

Use the equivalent GetPropertyText function to get a text property.

Example:

if (hotspot[1].GetProperty("Value") > 200)
  Display("Hotspot 1's value is over 200!");
will print the message if hotspot 1 has its "Value" property set to more than 200.

See Also: Hotspot.GetPropertyText


GetPropertyText (hotspot)

(Formerly known as GetHotspotPropertyText, which is now obsolete)

Hotspot.GetPropertyText(string property, string buffer)
Returns the custom property setting of the PROPERTY for the hotspot.

This command works with Text properties only. The property's text will be copied into the BUFFER that you pass to this command.

Use the equivalent GetProperty function to get a non-text property.

Example:

string buffer;
hotspot[2].GetPropertyText("Description", buffer);
Display("Hotspot 2's description: %s", buffer);
will retrieve hotspot 2's "description" property into the buffer, then display it.

See Also: Hotspot.GetProperty


RunInteraction (hotspot)

(Formerly known as RunHotspotInteraction, which is now obsolete)

Hotspot.RunInteraction(CursorMode)
Processes the interaction list as if the player had clicked the mouse on the hotspot using the specified cursor mode. May be useful with the text parser for simulating a mouse click if they type specific words in.

Example:

hDoor.RunInteraction(eModeLook);
will run the code defined in the "LOOK AT HOTSPOT" interaction for hotspot hDoor.

See Also: ProcessClick, Character.RunInteraction, Object.RunInteraction


Enabled property (hotspot)

(Formerly known as DisableHotspot, which is now obsolete)
(Formerly known as EnableHotspot, which is now obsolete)

bool Hotspot.Enabled
Enables/disables the specified hotspot. If you set this to false, then all areas of the screen that were previously made up of the hotspot now act as type 0 (no hotspot). You can turn the hotspot back on later by setting this back to true.

This setting is persisted in-game; that is, it will not be reset when the player re-enters the room.

The default value of this property is always true.

Example:

hBrownTree.Enabled = false;
will disable the hBrownTree hotspot.

See Also: Region.Enabled, RemoveWalkableArea, RestoreWalkableArea


ID property (hotspot)

readonly int Hotspot.ID
Gets the hotspot number of this hotspot. This allows you to interoperate with old script using the number-based hotspot functions.

Example:

Display("Hotspot hDoor is hotspot number %d.", hDoor.ID);
Display("Hotspot 3 is number %d.", hotspot[3].ID);
displays hDoor's hotspot number, and then displays hotspot 3's number (which will be 3).

See Also: Hotspot.GetAtScreenXY


WalkToX property

(Formerly known as GetHotspotPointX, which is now obsolete)

readonly int Hotspot.WalkToX
Gets the X room co-ordinate of the hotspot's walk-to point. If the hotspot does not have a walk-to point, returns -1.

Example:

player.Walk(hTable.WalkToX, hTable.WalkToY, eBlock, eWalkableAreas);
will move the character to hotspot hTable's walk-to point.

See Also: Hotspot.WalkToY, MoveCharacterToHotspot


WalkToY property

(Formerly known as GetHotspotPointY, which is now obsolete)

readonly int Hotspot.WalkToY
Gets the Y room co-ordinate of the hotspot's walk-to point. If the hotspot does not have a walk-to point, returns -1.

Example:

player.Walk(hTable.WalkToX, hTable.WalkToY, eBlock, eWalkableAreas);
will move the character to hotspot hTable's walk-to point.

See Also: Hotspot.WalkToX, MoveCharacterToHotspot

Browser Based Help. Published by chm2web software.
1