Is there a get mouse position function? Need to tell game where mouse is.

Started by MCF, Mon 15/12/2003 23:11:11

Previous topic - Next topic

MCF

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.  

Gilbert

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
}

SMF spam blocked by CleanTalk