Reference Any Hotspot

Started by Pyroman, Thu 25/08/2011 08:03:23

Previous topic - Next topic

Pyroman

Hey guys,

I searched around the wiki and forums (as best I could through google), and I couldn't find anything obvious that answered my question.
Hopefully this isn't too technical for the beginners forum!

Basically, I want to reference every hotspot so I can increase a variable each time any hotspot is hit. The problem is I can't find a way to reference every hotspot in one go, and I wanted to know if there was a simple in-built way to do this before I started hacking away.

Khris

Here:

Code: ags
  Hotspot*h;

  int i = 1;
  while (i < AGS_MAX_HOTSPOTS) {

    h = hotspot[i];

    Display(h.Name);

    i++;
  }


hotspot[0] is the area outside the drawn hotspots.

monkey0506

Hotspot 0 is a valid hotspot just like everything else, it's just treated as eLocationNothing by GetLocationType and Game.GetLocationName. Of course it's probably unlikely that you would want every single pixel of the screen to be covered by an interactable hotspot.. ::) But if there are event handlers linked to hotspot 0 then they will be properly called by ProcessClick.

..just sayin. :D

SMF spam blocked by CleanTalk