Mouse Click/Release on Inventory Items

Started by Turing, Mon 29/03/2004 21:33:00

Previous topic - Next topic

Turing

I am trying to create a Curse Of Monkey Island type GUI.  Using the Open Source Verb Coin demo (I can't remember where I found it, but if they're reading this, thanks a bunch!), I have created my Verb Coin interface, and have configured the game to open an inventory screen with the right mouse button.

What I want to do with the inventory is this:  If the player clicks on the inventory item, it will be selected and used as a the cursor, and will be used to interact with other items/hotspots in the game.  If the player clicks and holds the mouse button down over the item, the verb coin should appear, and the user can thus perform one of the verb coin actions on the inventory item.

The problem I'm having is that the mouse-click event on inventory items is not executed (i.e. the mouse_clicked function is not called) until the player has released the mouse button (unlike on hotspots, where the mouse click is executed when the button is clicked, whether or not it is released).

Is there a work-around for this?  Has anyone encountered the same problem?

Thanks.

Radiant

You may want to try the on_event function, which is called with parameter GUI_MDOWN whenever you click on a GUI, and GUI_MUP whenever you release the button.

Turing

That seems to have done the trick.  Thank you very much.

SMF spam blocked by CleanTalk