Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Coolio on Mon 24/07/2006 10:18:45

Title: problem setting inventory item height
Post by: Coolio on Mon 24/07/2006 10:18:45
I can't seem to set the item height for my inventory items.
I have read the section in the manual on this topic, but I can't get it to work.
Also the manual says to use "int InvWindow.ItemHeight;",
but then goes on to use the example
"invMain.ItemWidth = 50;
invMain.ItemHeight = 30;"
I have tried playing around with the script (putting the command under game_start), but can't get it to work.
Can someone please tell me EXACTLY what to write and where to write it. :)
Title: Re: problem setting inventory item height
Post by: Alynn on Mon 24/07/2006 10:40:22
InvWindow is your actual Inventory Window for your game. I believe that InvWindow defaults to the built in inventory window. If you have a self made inventory GUI you have to point to your inventory window.

So my first question before I can answer, do you have a custom made inventory window, or are you using the system inventory window?
Title: Re: problem setting inventory item height
Post by: Ashen on Mon 24/07/2006 10:45:04
As Alynn said, it depends on what you've called your InvWindow object. If you're using the default Inventory GUI, it's invCustomInv, so you'd use invCustomInv.ItemHeight = 50; (or whatever height you want). game_start would be the appropriate place - in what way is it not working (nothing happens, crash and error message, etc)?
You can also change the Item height and width in the editor, on the InvWindow object's Properties box.
Title: Re: problem setting inventory item height
Post by: Coolio on Mon 24/07/2006 10:55:07
what do you mean when you say "custom inventory window" I have changed the size of it if that's what you mean.
I want to make it so that my inventory items don't overlap.
It doesn't work in that an error message is displayed when saving or testing.
Title: Re: problem setting inventory item height
Post by: Ashen on Mon 24/07/2006 11:00:05
I believe Alynn is just refering to a GUI that you've made, with an InvWindow object on. By default, AGS used to use a hard-coded inventory GUI that you couldn't alter - now it defaults to the INVENTORY GUI (with the invCustomInv object), so you should be OK. (Unless you're using V2.62 or earlier - in which case the ItemHeight/Width properties DEFINITELY won't work.) To be sure, check your Global Script for the show_inventory_window function, and see which bit is commented out. The line gInventory.Visible = true; should be black, InventoryScreen(); (which opens the hard-coded one) should be green.

Post the error message - unless we know what's going wrong, we don't know how to put it right.
Title: Re: problem setting inventory item height
Post by: Coolio on Mon 24/07/2006 11:05:37
I just got it working. I needed to use "InvCustomInv" like you said.
Thanks for the help.Ã,  :)