Hi all,
So I'm shelving my cycle-through-item cursors-without-GUI idea, only because I don't have enough experience to script it properly.
I created a GUI for an item inventory and made a button with a cross to close it. However, it won't disappear for some reason.
My script (located in Global script)
function CloseInv_Click(GUIControl *control, MouseButton button) {
gGui1.Visible = false;
}
CloseInv is the name I gave to the button for closing the window.
Since it won't disappear, I'm wondering if there's a clash with the button I used to make it visible in the first place?
function OpenInventory_AnyClick()
{
gGui1.Visible = true;
}
Probably a version of this problem (http://www.adventuregamestudio.co.uk/forums/index.php?topic=51617.0) from a couple of threads down.
In order for a function to be run when you click on a button (as with most other game events), it must be created or linked through the properties/events panel in the GUI editor.
EDIT:
Fixed. I honestly did do it via the event the first time, so I don't know why it wasn't working.
Sorry for taking your time.
No problem, happy you got it working! (And yes, creating/linking events can be a bit fiddly, and it's fairly easy to get it wrong in some hard-to-notice way.)