Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: andrea on Fri 12/11/2004 13:48:07

Title: cursor change over hotspot and object
Post by: andrea on Fri 12/11/2004 13:48:07
hi

i'd like my cursor to change color, whenever it is over a hotspot or an object and change back to normal, when it is not. how do i do that?
Title: Re: cursor change over hotspot and object
Post by: Radiant on Fri 12/11/2004 13:57:54
In repeatedly_execute_always, check GetLocationType (mouse.x, mouse.y) and set cursor mode accordingly.
Title: Re: cursor change over hotspot and object
Post by: andrea on Fri 12/11/2004 15:48:46
sorry but i still don't get it. could somebody give me an example what exactly i have to put where exactly?
I'm not really into scripting...
Title: Re: cursor change over hotspot and object
Post by: Radiant on Fri 12/11/2004 15:54:43

function repeatedly_execute_always () {
  if (GetLocationType (mouse.x, mouse.y) == 0) SetMouseCursor (2);
  else   if (GetLocationType (mouse.x, mouse.y) == 1 SetMouseCursor (5);
  // etc
  else  SetMouseCursor (3);
}


(look up help page for GetLocType, and set a mouse cursor type for each type of location that you need)