Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Radiant on Tue 16/03/2004 12:56:12

Title: Right-click in inventory window
Post by: Radiant on Tue 16/03/2004 12:56:12
Hi there,

I'm using a Sierra-style GUI. In the inventory window, I have buttons for 'look', 'touch' and 'select'. These all work and set the cursor appropriately
Now I'd like to have the right mouse button switch between these three modes and cursors... but right-clicking on the inventory GUI box simply triggers a look action. Checking for MouseButtonDown (RIGHT)  [sp?] in the interface_click function doesn't seem to help...
any suggestions would be welcome.
Title: Re:Right-click in inventory window
Post by: Scorpiorus on Tue 06/04/2004 19:52:53
To catch mouse clicks over GUIs look for on_event() function:

function on_event (int event, int data) {

 if (event==GUI_MDOWN)  { // mouse button pressed over a GUI
   if (IsButtonDown(RIGHT)) {
     //cycle modes or whatever
     ...
   }
 }
}

~Cheers