Changing cursor on hotspots

Started by MarceloCSC, Wed 23/09/2009 05:23:33

Previous topic - Next topic

MarceloCSC

Hello, this is probably a stupid question, but I'm quite new here.

I wanted to make a first person adventure game such as Dark Fall or Scratches, so I'm thinking about assigning hotspots to areas that would lead the player forward or left or right, for example making the entrance to a corridor a hotspot, and when you click on it you are transferred to the corridor. But I would like the cursor to change automatically to an arrow on these locations. How can I do that?

I tried searching for a similar topic first, but I couldn't really find something to help me.

monkey0506

You could use mouse.SaveCursorUntilItLeaves, such as:

Code: ags
// room rep_ex perhaps?
  Hotspot *hat = Hotspot.GetAtScreenXY(mouse.x, mouse.y);
  if ((hat == null) || (hat == hotspot[0])) return;
  mouse.SaveCursorUntilItLeaves();
  if (hat == hNorth) mouse.Mode = eModeNorth;
  else if (hat == hEast) mouse.Mode = eModeEast;
  else if (hat == hSouth) mouse.Mode = eModeSouth;
  else if (hat == hWest) mouse.Mode = eModeWest;


Welcome to the forums by the way. ;)

SMF spam blocked by CleanTalk