Inventory window won't close [SOLVED]

Started by Mr Games, Sun 18/11/2018 19:55:32

Previous topic - Next topic

Mr Games

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)

Code: ags
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?

Code: ags
function OpenInventory_AnyClick()
{
  gGui1.Visible = true;
} 


Snarky

Probably a version of this problem 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.

Mr Games

#2
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.

Snarky

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.)

SMF spam blocked by CleanTalk