Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: MCF on Mon 15/12/2003 23:11:11

Title: Is there a get mouse position function? Need to tell game where mouse is.
Post by: MCF on Mon 15/12/2003 23:11:11
I am trying to make buttons that, when the mouse is positioned over them, they change image.  I have two sets of images for each button.  I have set hotspots over the areas and specified that when the mouse goes over the area, the graphic changes.  How can I make it so, when the mouse moves OFF the hotspot, the original image returns?

I am assuming I will need and if...else statement.  


___________________________


Answered my own question.  
Title: Re:Is there a get mouse position function? Need to tell game where mouse is.
Post by: Gilbert on Tue 16/12/2003 02:35:00
Check out the variables mouse.x and mouse.y .

You may also check out functions like GetHotspotAt() and related stuffs.

For example in your case you can do something like (suppose the image was changed while the cursor's over hotspot 5 and you wnat to do something when it's away):

if (GetHotspotAt(mouse.x,mouse.y)!=5){
//put whatever stuffs to change back the image here
}