Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: emma_north1 on Fri 17/10/2008 15:10:38

Title: Need Help Getting Inventory Button On GUI To Work [SOLVED]
Post by: emma_north1 on Fri 17/10/2008 15:10:38
I'm using a blank script (new game) and have uploaded my Inventory Screen and my control bar (the one at the top with all the buttons across, including inventory). I've successfully scripted the bar to only appear when the mouse gets to the top of the screen, and have had no problem programming the curser buttons to work. However I can't seem to get my Inventory button script right. Obviously when the player clicks that button I want them to be taken to my Inventory screen (gInventory), but nothing I try seems to work.

I've loaded up the demo game to see how that did it, but the script it's using doesn't work at all for me even though it's still in the new AGS. This is what they used:


function btnIconInv_Click(GUIControl *control, MouseButton button)
{
  show_inventory_window();
}


I know the top bit needs to be:


function Inventory_OnClick(GUIControl *control, MouseButton button)


But cannot get the next bit right. Please help!
Title: Re: Need Help Getting Inventory Button On GUI To Work (Blank Script)
Post by: thezombiecow on Fri 17/10/2008 15:14:23
Try:


function [whatever]
{
  gInventory.Visible = true;
}
Title: Re: Need Help Getting Inventory Button On GUI To Work (Blank Script)
Post by: emma_north1 on Fri 17/10/2008 15:21:54
Perfect! Thanks! I'll try and get the Inventory Window buttons working now!