mouseclick in gui

Started by Fekix, Sun 07/03/2004 17:31:14

Previous topic - Next topic

Fekix

If i press and hold my right mouse button an actionmenu pop-ups where i can choose different interactions. However íf i right click over a GUI it don't pop up. I need this for my Inventory GUI. Does anyone know how to recognize the right click over a GUI to pop up a new GUI?
Currently working on: My Little Real Life Adventure

Paper Carnival

first, you have to create your own inventory GUI. Then, you must check "Handle Inventory clicks in script", in general settings. Then, in the on_mouse_click function you put:

if (button == RIGHTINV) {
//do something
}
if (button == LEFTINV) {
//do something
}

I'm getting a bit offtopic now, but I think you should know that this:
if (button==WHEELNORTH) {
//dosomething
}
if (button==WHEELSOUTH) {
//dosomething
}
triggers the mouse wheel (you have to check "Enable mouse wheel support" in the general settings). Just in case you didn't know that, I said this because it's kinda relevant to your question

Ishmael

You will need to do this with the repeadetly_execute function...

Put into the repeadetly_execute:

if (IsButtonDown(RIGHT)) {
//the actionmenu pupup code
} else {
//the actionmenu off code, something like GUIOff(...);
}
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

Fekix

thank you both for your suggestions but i already solved my problem with the "on_event" function and it works fine :)
Currently working on: My Little Real Life Adventure

SMF spam blocked by CleanTalk