Problem with Mouse Over GUI [SOLVED]

Started by Kain_V, Sun 22/02/2009 20:02:57

Previous topic - Next topic

Kain_V

Hi, I am trying to make a GK2 style game so I have a GUI appearing on the bottom of the background room (always visible) . And I want the mouse to change mode each time it passes the edges of the room to an exit mouse cursor, and then to change back again. So I put 3 hotspots with the following code:

Code: ags

function hHotspot2_MouseMove()
{
  mouse.SaveCursorUntilItLeaves();
  mouse.Mode= eModeRoomExitL;

}

function hHotspot3_MouseMove()
{
  mouse.SaveCursorUntilItLeaves();
  mouse.Mode= eModeExitright;
}

function hHotspot4_MouseMove()
{
  mouse.SaveCursorUntilItLeaves();
  mouse.Mode= eModeExitDown;
}


The problem is that when my cursor passes the hotspot at the bottom edge and moves over the GUI it changes to exit cursor and stays that way... How can I set a specific cursor mode when the cursor is over the GUI?

For an image go to:

http://img24.imageshack.us/my.php?image=roomgui.png

Makeout Patrol

The way I would do it is to put the code for changing the mouse mode in the game's 'repeatedly execute' function; when the mouse is below a certain y-coordinate, change it to 'pointer' for the GUI, when the mouse is over each of the exit regions, switch it to the exit cursor, and when the mouse is over none of those, change it to the default mode. That way, you also wouldn't need to put this code in every single room.

Kain_V

Thanks for the quick reply!
I'm not much of a scripter so, can you show me the code, how would you do it?

Ultra Magnus

There are 2 or 3 different methods in this post.
I don't mean to sound bitter, cold, or cruel, but I am, so that's how it comes out.

I'm tired of pretending I'm not bitchin', a total frickin' rock star from Mars.

Kain_V

Thanks for the help guys!
Another problem solved!  ;D

SMF spam blocked by CleanTalk