Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: M on Fri 13/06/2003 11:31:49

Title: Cursor over character/object q
Post by: M on Fri 13/06/2003 11:31:49
Yeah, I really hate to ask for help at this stage coz I've worked out so much stuff myself but this one's killing me...

Basically, when the cursor is over a hotspot - it changes its appearance to a highlighted sprite. If its not on a hotspot, it changes its appearance to an unhighlighted sprite thats just plain. I've got all that working in the repeatedly execute part of the global script.

The thing is I don't know how to do this for when the cursor is over characters and objects. Is there a function to test whether the mouse is over objects and characters?
Title: Re:Cursor over character/object q
Post by: on Fri 13/06/2003 11:36:11
I believe this should work (in the repeatedly_execute):

if (GetLocationType(mouse.x,mouse.y)>0){
 SetCursorGraphic(...);  //Can't remember if this is the function coz I don't have AGS on this computer
}

Check the manual for more info on those functions..
Title: Re:Cursor over character/object q
Post by: on Fri 13/06/2003 11:37:46
correction:

if (GetLocationType(mouse.x,mouse.y)>0){    // highlighted
 ...
} else   // Not highlighted
 ...
}
Title: Re:Cursor over character/object q
Post by: M on Fri 13/06/2003 11:41:23

Ah great. Thanks. I'll just check it in a sec....
Title: Re:Cursor over character/object q
Post by: M on Fri 13/06/2003 11:43:20
Damn, thats a lot easier than what I was doing. Cheers, AJA. Thats very useful. Progress continues.

And CJ, that context-sensitive help is really helpful  ;D